Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using constexpr with std::numeric_limits consistently #2911

Open
springmeyer opened this issue Jun 12, 2015 · 0 comments
Open

using constexpr with std::numeric_limits consistently #2911

springmeyer opened this issue Jun 12, 2015 · 0 comments

Comments

@springmeyer
Copy link
Member

For best performance with C++11 it is now possible to use things like std::numeric_limits<type>::max() as constexpr. At least on mac and unix - windows does not yet support this. In reviewing current usage of std::numeric_limits we are currently:

  • Using constexpr std::numeric_limits in one place, and it breaks on windows - pixel_cast.hpp(134): error C2134: 'std::numeric_limits<float>::max': call does not result in a constant expression - refs Remove numeric_cast from image_util.cpp #2893 (comment)
  • Using static const std::numeric_limits in several places including src/grid/grid.cpp and include/mapnik/text/font_feature_settings.hpp
  • Using non static const in a lot of different places

The plan going forward is to clean this up so that we are using: static MAPNIK_CONSTEXPR std::numeric_limits ... everywhere possible and where MAPNIK_CONSTEXPR will be constexpr on unix and const on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants