update boost on linux
This commit is contained in:
@@ -32,7 +32,7 @@ struct reduce_unit<absolute<unit<D, S> > >
|
||||
namespace detail {
|
||||
|
||||
struct undefined_affine_conversion_base {
|
||||
static const bool is_defined = false;
|
||||
BOOST_STATIC_CONSTEXPR bool is_defined = false;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
@@ -51,7 +51,7 @@ struct affine_conversion_impl<true, ReverseIsDefined>
|
||||
{
|
||||
template<class Unit1, class Unit2, class T0, class T1>
|
||||
struct apply {
|
||||
static T1 value(const T0& t0)
|
||||
static BOOST_CONSTEXPR T1 value(const T0& t0)
|
||||
{
|
||||
return(
|
||||
t0 *
|
||||
@@ -67,7 +67,7 @@ struct affine_conversion_impl<false, true>
|
||||
template<class Unit1, class Unit2, class T0, class T1>
|
||||
struct apply
|
||||
{
|
||||
static T1 value(const T0& t0)
|
||||
static BOOST_CONSTEXPR T1 value(const T0& t0)
|
||||
{
|
||||
return(
|
||||
(t0 - affine_conversion_helper<typename reduce_unit<Unit2>::type, typename reduce_unit<Unit1>::type>::value()) *
|
||||
@@ -84,7 +84,7 @@ struct conversion_helper<quantity<absolute<Unit1>, T1>, quantity<absolute<Unit2>
|
||||
{
|
||||
typedef quantity<absolute<Unit1>, T1> from_quantity_type;
|
||||
typedef quantity<absolute<Unit2>, T2> to_quantity_type;
|
||||
static to_quantity_type convert(const from_quantity_type& source)
|
||||
static BOOST_CONSTEXPR to_quantity_type convert(const from_quantity_type& source)
|
||||
{
|
||||
return(
|
||||
to_quantity_type::from_value(
|
||||
|
||||
@@ -46,12 +46,12 @@ struct call_base_unit_converter;
|
||||
|
||||
/// INTERNAL ONLY
|
||||
struct undefined_base_unit_converter_base {
|
||||
static const bool is_defined = false;
|
||||
BOOST_STATIC_CONSTEXPR bool is_defined = false;
|
||||
};
|
||||
|
||||
/// INTERNAL ONLY
|
||||
struct no_default_conversion {
|
||||
static const bool is_defined = false;
|
||||
BOOST_STATIC_CONSTEXPR bool is_defined = false;
|
||||
};
|
||||
|
||||
/// INTERNAL ONLY
|
||||
@@ -110,11 +110,10 @@ struct base_unit_converter_base : undefined_base_unit_converter_base {
|
||||
template<class Source>
|
||||
struct base_unit_converter_base<Source, BOOST_UNITS_MAKE_HETEROGENEOUS_UNIT(Source, typename Source::dimension_type)>
|
||||
{
|
||||
static const bool is_defined = true;
|
||||
BOOST_STATIC_CONSTEXPR bool is_defined = true;
|
||||
typedef one type;
|
||||
static type value() {
|
||||
one result;
|
||||
return(result);
|
||||
static BOOST_CONSTEXPR type value() {
|
||||
return(one());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -135,7 +134,7 @@ struct do_call_base_unit_converter {
|
||||
typedef typename mpl::divides<source_factor, destination_factor>::type factor;
|
||||
typedef eval_scale_list<factor> eval_factor;
|
||||
typedef typename multiply_typeof_helper<typename converter::type, typename eval_factor::type>::type type;
|
||||
static type value()
|
||||
static BOOST_CONSTEXPR type value()
|
||||
{
|
||||
return(converter::value() * eval_factor::value());
|
||||
}
|
||||
@@ -172,9 +171,8 @@ struct call_base_unit_converter_base_unit_impl<false, true>
|
||||
{
|
||||
typedef do_call_base_unit_converter<Dest, typename Source::unit_type> converter;
|
||||
typedef typename divide_typeof_helper<one, typename converter::type>::type type;
|
||||
static type value() {
|
||||
one numerator;
|
||||
return(numerator / converter::value());
|
||||
static BOOST_CONSTEXPR type value() {
|
||||
return(one() / converter::value());
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -200,7 +198,7 @@ struct call_base_unit_converter_base_unit_impl<false, false>
|
||||
>::type,
|
||||
typename end::type
|
||||
>::type type;
|
||||
static type value() {
|
||||
static BOOST_CONSTEXPR type value() {
|
||||
return(start::value() * conversion::value() / end::value());
|
||||
}
|
||||
};
|
||||
@@ -220,7 +218,7 @@ struct get_default_conversion_impl
|
||||
typedef typename multiply_typeof_helper<typename power_typeof_helper<new_source, exponent>::type, typename next_iteration::unit_type>::type unit_type;
|
||||
typedef call_base_unit_converter<source, new_source> conversion;
|
||||
typedef typename multiply_typeof_helper<typename conversion::type, typename next_iteration::type>::type type;
|
||||
static type value() {
|
||||
static BOOST_CONSTEXPR type value() {
|
||||
return(static_rational_power<exponent>(conversion::value()) * next_iteration::value());
|
||||
}
|
||||
};
|
||||
@@ -234,9 +232,8 @@ struct get_default_conversion_impl<0>
|
||||
{
|
||||
typedef unit<dimensionless_type, heterogeneous_system<heterogeneous_system_impl<dimensionless_type, dimensionless_type, no_scale> > > unit_type;
|
||||
typedef one type;
|
||||
static one value() {
|
||||
one result;
|
||||
return(result);
|
||||
static BOOST_CONSTEXPR one value() {
|
||||
return(one());
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -272,7 +269,7 @@ struct call_base_unit_converter_impl<false>
|
||||
>::type,
|
||||
typename impl::type
|
||||
>::type type;
|
||||
static type value() {
|
||||
static BOOST_CONSTEXPR type value() {
|
||||
return(start::value() * conversion::value() / impl::value());
|
||||
}
|
||||
};
|
||||
@@ -314,7 +311,7 @@ struct conversion_impl
|
||||
typedef typename reduce_unit<units::unit<dimensions, DestinationSystem> >::type reduced_unit;
|
||||
typedef detail::call_base_unit_converter<unit, reduced_unit> converter;
|
||||
typedef typename multiply_typeof_helper<typename converter::type, typename next_iteration::type>::type type;
|
||||
static type value() { return(static_rational_power<typename unit_pair::value_type>(converter::value()) * next_iteration::value()); }
|
||||
static BOOST_CONSTEXPR type value() { return(static_rational_power<typename unit_pair::value_type>(converter::value()) * next_iteration::value()); }
|
||||
};
|
||||
};
|
||||
|
||||
@@ -325,7 +322,7 @@ struct conversion_impl<0>
|
||||
struct apply
|
||||
{
|
||||
typedef one type;
|
||||
static type value() { one result; return(result); }
|
||||
static BOOST_CONSTEXPR type value() { return(one()); }
|
||||
};
|
||||
};
|
||||
|
||||
@@ -338,11 +335,9 @@ struct conversion_helper<quantity<Unit1, T1>, quantity<Unit2, T2> >
|
||||
{
|
||||
/// INTERNAL ONLY
|
||||
typedef quantity<Unit2, T2> destination_type;
|
||||
static destination_type convert(const quantity<Unit1, T1>& source)
|
||||
static BOOST_CONSTEXPR destination_type convert(const quantity<Unit1, T1>& source)
|
||||
{
|
||||
Unit1 u1;
|
||||
Unit2 u2;
|
||||
return(destination_type::from_value(static_cast<T2>(source.value() * conversion_factor(u1, u2))));
|
||||
return(destination_type::from_value(static_cast<T2>(source.value() * conversion_factor(Unit1(), Unit2()))));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -365,7 +360,7 @@ struct conversion_factor_helper<unit<D, homogeneous_system<L1> >, unit<D, homoge
|
||||
// homogeneous_system<L2>
|
||||
//> impl;
|
||||
//typedef typename impl::type type;
|
||||
//static type value()
|
||||
//static BOOST_CONSTEXPR type value()
|
||||
//{
|
||||
// return(impl::value());
|
||||
//}
|
||||
@@ -384,7 +379,7 @@ struct conversion_factor_helper<unit<D, heterogeneous_system<L1> >, unit<D, homo
|
||||
//> impl;
|
||||
//typedef eval_scale_list<typename L1::scale> scale;
|
||||
//typedef typename multiply_typeof_helper<typename impl::type, typename scale::type>::type type;
|
||||
//static type value()
|
||||
//static BOOST_CONSTEXPR type value()
|
||||
//{
|
||||
// return(impl::value() * scale::value());
|
||||
//}
|
||||
@@ -406,10 +401,9 @@ struct conversion_factor_helper<unit<D, homogeneous_system<L1> >, unit<D, hetero
|
||||
//> impl;
|
||||
//typedef eval_scale_list<typename L2::scale> scale;
|
||||
//typedef typename multiply_typeof_helper<typename impl::type, typename scale::type>::type type;
|
||||
//static type value()
|
||||
//static BOOST_CONSTEXPR type value()
|
||||
//{
|
||||
// one numerator;
|
||||
// return(numerator / (impl::value() * scale::value()));
|
||||
// return(one() / (impl::value() * scale::value()));
|
||||
//}
|
||||
};
|
||||
|
||||
@@ -443,7 +437,7 @@ struct conversion_factor_helper<unit<D, heterogeneous_system<S1> >, unit<D, hete
|
||||
typename conversion1::type,
|
||||
typename divide_typeof_helper<typename scale::type, typename conversion2::type>::type
|
||||
>::type type;
|
||||
static type value()
|
||||
static BOOST_CONSTEXPR type value()
|
||||
{
|
||||
return(conversion1::value() * (scale::value() / conversion2::value()));
|
||||
}
|
||||
|
||||
@@ -598,8 +598,8 @@ struct set_insert<false> {
|
||||
|
||||
template<class Set, class T>
|
||||
struct has_key {
|
||||
static const long size = sizeof(Set::lookup((wrap<T>*)0));
|
||||
static const bool value = (size == sizeof(set_yes));
|
||||
BOOST_STATIC_CONSTEXPR long size = sizeof(Set::lookup((wrap<T>*)0));
|
||||
BOOST_STATIC_CONSTEXPR bool value = (size == sizeof(set_yes));
|
||||
};
|
||||
|
||||
template<int N>
|
||||
@@ -826,7 +826,7 @@ struct normalize_units {
|
||||
dimensions
|
||||
>::type matrix;
|
||||
typedef typename make_square_and_invert<matrix>::type type;
|
||||
static const long extra = (type::size::value) - (T::size::value);
|
||||
BOOST_STATIC_CONSTEXPR long extra = (type::size::value) - (T::size::value);
|
||||
};
|
||||
|
||||
// multiply_add_units computes M x V
|
||||
@@ -977,7 +977,7 @@ struct is_simple_system_impl {
|
||||
typename test::base_dimension_type
|
||||
>
|
||||
> type;
|
||||
static const bool value = (type::value);
|
||||
BOOST_STATIC_CONSTEXPR bool value = (type::value);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1001,7 +1001,7 @@ struct is_simple_system {
|
||||
typename test::base_dimension_type
|
||||
>
|
||||
>::type type;
|
||||
static const bool value = type::value;
|
||||
BOOST_STATIC_CONSTEXPR bool value = type::value;
|
||||
};
|
||||
|
||||
template<bool>
|
||||
|
||||
@@ -17,12 +17,11 @@ namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
struct one { one() {} };
|
||||
struct one { BOOST_CONSTEXPR one() {} };
|
||||
|
||||
// workaround for pathscale.
|
||||
inline one make_one() {
|
||||
one result;
|
||||
return(result);
|
||||
inline BOOST_CONSTEXPR one make_one() {
|
||||
return(one());
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -44,21 +43,20 @@ struct multiply_typeof_helper<one, one>
|
||||
};
|
||||
|
||||
template<class T>
|
||||
inline T operator*(const one&, const T& t)
|
||||
inline BOOST_CONSTEXPR T operator*(const one&, const T& t)
|
||||
{
|
||||
return(t);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline T operator*(const T& t, const one&)
|
||||
inline BOOST_CONSTEXPR T operator*(const T& t, const one&)
|
||||
{
|
||||
return(t);
|
||||
}
|
||||
|
||||
inline one operator*(const one&, const one&)
|
||||
inline BOOST_CONSTEXPR one operator*(const one&, const one&)
|
||||
{
|
||||
one result;
|
||||
return(result);
|
||||
return(one());
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -80,32 +78,31 @@ struct divide_typeof_helper<one, one>
|
||||
};
|
||||
|
||||
template<class T>
|
||||
inline T operator/(const T& t, const one&)
|
||||
inline BOOST_CONSTEXPR T operator/(const T& t, const one&)
|
||||
{
|
||||
return(t);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline T operator/(const one&, const T& t)
|
||||
inline BOOST_CONSTEXPR T operator/(const one&, const T& t)
|
||||
{
|
||||
return(1/t);
|
||||
}
|
||||
|
||||
inline one operator/(const one&, const one&)
|
||||
inline BOOST_CONSTEXPR one operator/(const one&, const one&)
|
||||
{
|
||||
one result;
|
||||
return(result);
|
||||
return(one());
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline bool operator>(const boost::units::one&, const T& t) {
|
||||
inline BOOST_CONSTEXPR bool operator>(const boost::units::one&, const T& t) {
|
||||
return(1 > t);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
T one_to_double(const T& t) { return t; }
|
||||
BOOST_CONSTEXPR T one_to_double(const T& t) { return t; }
|
||||
|
||||
inline double one_to_double(const one&) { return 1.0; }
|
||||
inline BOOST_CONSTEXPR double one_to_double(const one&) { return 1.0; }
|
||||
|
||||
template<class T>
|
||||
struct one_to_double_type { typedef T type; };
|
||||
|
||||
@@ -26,11 +26,11 @@ struct ordinal_tag {};
|
||||
template<int N>
|
||||
struct ordinal {
|
||||
typedef detail::ordinal_tag tag;
|
||||
static const long value = N;
|
||||
BOOST_STATIC_CONSTEXPR long value = N;
|
||||
};
|
||||
|
||||
template<int N>
|
||||
const long ordinal<N>::value;
|
||||
BOOST_CONSTEXPR_OR_CONST long ordinal<N>::value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace units {
|
||||
|
||||
namespace detail {
|
||||
|
||||
struct no { no() {} char dummy; };
|
||||
struct no { BOOST_CONSTEXPR no() : dummy() {} char dummy; };
|
||||
struct yes { no dummy[2]; };
|
||||
|
||||
template<bool> struct ordinal_has_already_been_defined;
|
||||
@@ -37,15 +37,17 @@ struct ordinal_has_already_been_defined<false> { typedef void type; };
|
||||
/// be found by ADL
|
||||
/// INTERNAL ONLY
|
||||
template<class T>
|
||||
BOOST_CONSTEXPR
|
||||
detail::no
|
||||
boost_units_is_registered(const T&)
|
||||
{ detail::no result; return(result); }
|
||||
{ return(detail::no()); }
|
||||
|
||||
/// INTERNAL ONLY
|
||||
template<class T>
|
||||
BOOST_CONSTEXPR
|
||||
detail::no
|
||||
boost_units_unit_is_registered(const T&)
|
||||
{ detail::no result; return(result); }
|
||||
{ return(detail::no()); }
|
||||
|
||||
} // namespace units
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ template<class R, class Y>
|
||||
struct static_rational_power_impl
|
||||
{
|
||||
typedef typename typeof_pow_adl_barrier::typeof_pow<Y>::type type;
|
||||
static type call(const Y& y)
|
||||
static BOOST_CONSTEXPR type call(const Y& y)
|
||||
{
|
||||
using std::pow;
|
||||
return(pow(y, static_cast<double>(R::Numerator) / static_cast<double>(R::Denominator)));
|
||||
@@ -61,10 +61,9 @@ template<class R>
|
||||
struct static_rational_power_impl<R, one>
|
||||
{
|
||||
typedef one type;
|
||||
static one call(const one&)
|
||||
static BOOST_CONSTEXPR one call(const one&)
|
||||
{
|
||||
one result;
|
||||
return(result);
|
||||
return(one());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -72,10 +71,9 @@ template<long N>
|
||||
struct static_rational_power_impl<static_rational<N, 1>, one>
|
||||
{
|
||||
typedef one type;
|
||||
static one call(const one&)
|
||||
static BOOST_CONSTEXPR one call(const one&)
|
||||
{
|
||||
one result;
|
||||
return(result);
|
||||
return(one());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -91,10 +89,9 @@ struct static_int_power_impl<N, true>
|
||||
typedef typename multiply_typeof_helper<Y, Y>::type square_type;
|
||||
typedef typename static_int_power_impl<(N >> 1)>::template apply<square_type, R> next;
|
||||
typedef typename next::type type;
|
||||
static type call(const Y& y, const R& r)
|
||||
static BOOST_CONSTEXPR type call(const Y& y, const R& r)
|
||||
{
|
||||
const square_type square = y * y;
|
||||
return(next::call(square, r));
|
||||
return(next::call(static_cast<square_type>(y * y), r));
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -109,10 +106,9 @@ struct static_int_power_impl<N, false>
|
||||
typedef typename multiply_typeof_helper<Y, R>::type new_r;
|
||||
typedef typename static_int_power_impl<(N >> 1)>::template apply<square_type, new_r> next;
|
||||
typedef typename next::type type;
|
||||
static type call(const Y& y, const R& r)
|
||||
static BOOST_CONSTEXPR type call(const Y& y, const R& r)
|
||||
{
|
||||
const Y square = y * y;
|
||||
return(next::call(square, y * r));
|
||||
return(next::call(static_cast<Y>(y * y), y * r));
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -124,7 +120,7 @@ struct static_int_power_impl<1, false>
|
||||
struct apply
|
||||
{
|
||||
typedef typename multiply_typeof_helper<Y, R>::type type;
|
||||
static type call(const Y& y, const R& r)
|
||||
static BOOST_CONSTEXPR type call(const Y& y, const R& r)
|
||||
{
|
||||
return(y * r);
|
||||
}
|
||||
@@ -138,7 +134,7 @@ struct static_int_power_impl<0, true>
|
||||
struct apply
|
||||
{
|
||||
typedef R type;
|
||||
static R call(const Y&, const R& r)
|
||||
static BOOST_CONSTEXPR R call(const Y&, const R& r)
|
||||
{
|
||||
return(r);
|
||||
}
|
||||
@@ -156,10 +152,9 @@ struct static_int_power_sign_impl<N, false>
|
||||
{
|
||||
typedef typename static_int_power_impl<N>::template apply<Y, one> impl;
|
||||
typedef typename impl::type type;
|
||||
static type call(const Y& y)
|
||||
static BOOST_CONSTEXPR type call(const Y& y)
|
||||
{
|
||||
one result;
|
||||
return(impl::call(y, result));
|
||||
return(impl::call(y, one()));
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -172,10 +167,9 @@ struct static_int_power_sign_impl<N, true>
|
||||
{
|
||||
typedef typename static_int_power_impl<-N>::template apply<Y, one> impl;
|
||||
typedef typename divide_typeof_helper<one, typename impl::type>::type type;
|
||||
static type call(const Y& y)
|
||||
static BOOST_CONSTEXPR type call(const Y& y)
|
||||
{
|
||||
one result;
|
||||
return(result/impl::call(y, result));
|
||||
return(one()/impl::call(y, one()));
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -185,13 +179,14 @@ struct static_rational_power_impl<static_rational<N, 1>, Y>
|
||||
{
|
||||
typedef typename static_int_power_sign_impl<N>::template apply<Y> impl;
|
||||
typedef typename impl::type type;
|
||||
static type call(const Y& y)
|
||||
static BOOST_CONSTEXPR type call(const Y& y)
|
||||
{
|
||||
return(impl::call(y));
|
||||
}
|
||||
};
|
||||
|
||||
template<class R, class Y>
|
||||
BOOST_CONSTEXPR
|
||||
typename detail::static_rational_power_impl<R, Y>::type static_rational_power(const Y& y)
|
||||
{
|
||||
return(detail::static_rational_power_impl<R, Y>::call(y));
|
||||
|
||||
@@ -143,7 +143,7 @@ struct eval_scale_list_impl
|
||||
{
|
||||
typedef typename eval_scale_list_impl<N-1>::template apply<typename Begin::next> next_iteration;
|
||||
typedef typename multiply_typeof_helper<typename next_iteration::type, typename Begin::item::value_type>::type type;
|
||||
static type value()
|
||||
static BOOST_CONSTEXPR type value()
|
||||
{
|
||||
return(next_iteration::value() * Begin::item::value());
|
||||
}
|
||||
@@ -157,10 +157,9 @@ struct eval_scale_list_impl<0>
|
||||
struct apply
|
||||
{
|
||||
typedef one type;
|
||||
static one value()
|
||||
static BOOST_CONSTEXPR one value()
|
||||
{
|
||||
one result;
|
||||
return(result);
|
||||
return(one());
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -225,6 +224,22 @@ struct times_impl<boost::units::scale_dim_tag, boost::units::detail::static_rati
|
||||
};
|
||||
};
|
||||
|
||||
/// INTERNAL ONLY
|
||||
template<>
|
||||
struct divides_impl<boost::units::scale_dim_tag, boost::units::detail::static_rational_tag>
|
||||
{
|
||||
template<class T0, class T1>
|
||||
struct apply
|
||||
{
|
||||
typedef boost::units::scale_list_dim<
|
||||
boost::units::scale<
|
||||
(T0::base),
|
||||
typename mpl::divides<typename T0::exponent, T1>::type
|
||||
>
|
||||
> type;
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace mpl
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user