diff options
Diffstat (limited to 'boost/units/unit.hpp')
-rw-r--r-- | boost/units/unit.hpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/boost/units/unit.hpp b/boost/units/unit.hpp index 7d3a8ad46f..aa4611cf7f 100644 --- a/boost/units/unit.hpp +++ b/boost/units/unit.hpp @@ -42,11 +42,11 @@ class unit typedef Dim dimension_type; typedef System system_type; - unit() { } - unit(const this_type&) { } + BOOST_CONSTEXPR unit() { } + BOOST_CONSTEXPR unit(const this_type&) { } //~unit() { } - this_type& operator=(const this_type&) { return *this; } + BOOST_CXX14_CONSTEXPR this_type& operator=(const this_type&) { return *this; } // sun will ignore errors resulting from templates // instantiated in the return type of a function. @@ -305,7 +305,7 @@ struct power_typeof_helper<unit<Dim,System>,static_rational<N,D> > { typedef unit<typename static_power<Dim,static_rational<N,D> >::type,typename static_power<System, static_rational<N,D> >::type> type; - static type value(const unit<Dim,System>&) + static BOOST_CONSTEXPR type value(const unit<Dim,System>&) { return type(); } @@ -317,7 +317,7 @@ struct root_typeof_helper<unit<Dim,System>,static_rational<N,D> > { typedef unit<typename static_root<Dim,static_rational<N,D> >::type,typename static_root<System, static_rational<N,D> >::type> type; - static type value(const unit<Dim,System>&) + static BOOST_CONSTEXPR type value(const unit<Dim,System>&) { return type(); } @@ -325,6 +325,7 @@ struct root_typeof_helper<unit<Dim,System>,static_rational<N,D> > /// unit runtime unary plus template<class Dim,class System> +BOOST_CONSTEXPR typename unary_plus_typeof_helper< unit<Dim,System> >::type operator+(const unit<Dim,System>&) { @@ -335,6 +336,7 @@ operator+(const unit<Dim,System>&) /// unit runtime unary minus template<class Dim,class System> +BOOST_CONSTEXPR typename unary_minus_typeof_helper< unit<Dim,System> >::type operator-(const unit<Dim,System>&) { @@ -348,6 +350,7 @@ template<class Dim1, class Dim2, class System1, class System2> +BOOST_CONSTEXPR typename add_typeof_helper< unit<Dim1,System1>, unit<Dim2,System2> >::type operator+(const unit<Dim1,System1>&,const unit<Dim2,System2>&) @@ -366,6 +369,7 @@ template<class Dim1, class Dim2, class System1, class System2> +BOOST_CONSTEXPR typename subtract_typeof_helper< unit<Dim1,System1>, unit<Dim2,System2> >::type operator-(const unit<Dim1,System1>&,const unit<Dim2,System2>&) @@ -384,6 +388,7 @@ template<class Dim1, class Dim2, class System1, class System2> +BOOST_CONSTEXPR typename multiply_typeof_helper< unit<Dim1,System1>, unit<Dim2,System2> >::type operator*(const unit<Dim1,System1>&,const unit<Dim2,System2>&) @@ -399,6 +404,7 @@ template<class Dim1, class Dim2, class System1, class System2> +BOOST_CONSTEXPR typename divide_typeof_helper< unit<Dim1,System1>, unit<Dim2,System2> >::type operator/(const unit<Dim1,System1>&,const unit<Dim2,System2>&) @@ -415,6 +421,7 @@ template<class Dim1, class System1, class System2> inline +BOOST_CONSTEXPR bool operator==(const unit<Dim1,System1>&,const unit<Dim2,System2>&) { @@ -427,6 +434,7 @@ template<class Dim1, class System1, class System2> inline +BOOST_CONSTEXPR bool operator!=(const unit<Dim1,System1>&,const unit<Dim2,System2>&) { |