Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Remove LatLng::null, vec2::null, and operator bool#4355

Closed
jfirebaugh wants to merge 1 commit into
masterfrom
non-nan
Closed

Remove LatLng::null, vec2::null, and operator bool#4355
jfirebaugh wants to merge 1 commit into
masterfrom
non-nan

Conversation

@jfirebaugh
Copy link
Copy Markdown
Contributor

Instead of using NaN, 0 or other special values to indicate the lack of a real LatLng or vec2 value, we should use optional<LatLng> or optional<vec2>.

Refs #3802, #4285.

cc @brunoabinader

@jfirebaugh jfirebaugh changed the title Remove LatLng::null and default constructor arguments Remove LatLng::null, vecN::null, and default constructor arguments Mar 16, 2016
@jfirebaugh jfirebaugh changed the title Remove LatLng::null, vecN::null, and default constructor arguments Remove LatLng::null, vec2::null, and default constructor arguments Mar 16, 2016
@jfirebaugh jfirebaugh changed the title Remove LatLng::null, vec2::null, and default constructor arguments Remove LatLng::null, vec2::null, and operator bool Mar 17, 2016
@jfirebaugh jfirebaugh force-pushed the non-nan branch 2 times, most recently from 7c23545 to 7b05851 Compare March 17, 2016 21:45
@brunoabinader
Copy link
Copy Markdown
Contributor

👍 Glad to see one of the best idioms I learned while learning Rust (together with type traits) in C++!

Comment thread include/mbgl/util/geo.hpp
double easting = 0;

ProjectedMeters(double n = 0, double e = 0)
ProjectedMeters(double n, double e)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't ProjectedMeters ctor params have the same NaN/infinite checks as in LatLng?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants