boostorg/units — pull request #10 by gnzlbg (2014-08-28 14:39:40+00:00)
Title: Initial constexpr support

Adds initial constexpr support to Boost.Units.

There is some functionality that might only work on C++1z, C++14, and C++11 although most of the functionality works on C++11 and almost all of it works on C++14 (due to relaxed constexpr). Future work might offer C++11 compatible alternatives to relaxed constexpr.

Most of the tests have been updated to be conditionally constexpr if support is available. Duplicating all test for constexpr is a maintenance nightmare. Boost.Test should offer a STATIC_CHECK_IF_CONSTEXPR macro that performs a static assert if the compiler supports constexpr or a normal CHECK otherwise. Future work might consider implementing such a macro within Boost.Units and using it where it makes sense.

The radar beam height example has been updated to use constexpr. If the compiler supports C++11's constexpr the result is computed at compile-time and if the compiler also supports C++11's static_assert the result is also verified at compile-time.