summaryrefslogtreecommitdiff
path: root/boost/units/conversion.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
commitb8cf34c691623e4ec329053cbbf68522a855882d (patch)
tree34da08632a99677f6b79ecb65e5b655a5b69a67f /boost/units/conversion.hpp
parent3fdc3e5ee96dca5b11d1694975a65200787eab86 (diff)
downloadboost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.gz
boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.bz2
boost-b8cf34c691623e4ec329053cbbf68522a855882d.zip
Imported Upstream version 1.67.0upstream/1.67.0
Diffstat (limited to 'boost/units/conversion.hpp')
-rw-r--r--boost/units/conversion.hpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/boost/units/conversion.hpp b/boost/units/conversion.hpp
index 2e5d4db6d4..f5d4a1ef2f 100644
--- a/boost/units/conversion.hpp
+++ b/boost/units/conversion.hpp
@@ -51,7 +51,7 @@ struct conversion_helper;
template<class From, class To>
struct conversion_helper
{
- static To convert(const From&);
+ static BOOST_CONSTEXPR To convert(const From&);
};
#endif
@@ -77,9 +77,9 @@ struct conversion_helper
template<> \
struct base_unit_converter<Source, reduce_unit<Destination::unit_type>::type> \
{ \
- static const bool is_defined = true; \
+ BOOST_STATIC_CONSTEXPR bool is_defined = true; \
typedef type_ type; \
- static type value() { return(value_); } \
+ static BOOST_CONSTEXPR type value() { return(value_); } \
}; \
} \
} \
@@ -103,9 +103,9 @@ struct conversion_helper
BOOST_UNITS_MAKE_HETEROGENEOUS_UNIT(Destination, typename Source::dimension_type)\
> \
{ \
- static const bool is_defined = true; \
+ BOOST_STATIC_CONSTEXPR bool is_defined = true; \
typedef type_ type; \
- static type value() { return(value_); } \
+ static BOOST_CONSTEXPR type value() { return(value_); } \
}; \
} \
} \
@@ -121,7 +121,7 @@ struct conversion_helper
template<> \
struct unscaled_get_default_conversion<unscale<Source>::type> \
{ \
- static const bool is_defined = true; \
+ BOOST_STATIC_CONSTEXPR bool is_defined = true; \
typedef Dest::unit_type type; \
}; \
} \
@@ -140,7 +140,7 @@ struct conversion_helper
template<BOOST_PP_SEQ_ENUM(Params)> \
struct unscaled_get_default_conversion<Source> \
{ \
- static const bool is_defined = true; \
+ BOOST_STATIC_CONSTEXPR bool is_defined = true; \
typedef typename Dest::unit_type type; \
}; \
} \
@@ -158,8 +158,8 @@ namespace units { \
namespace namespace_ { \
struct name_ ## _base_unit \
: base_unit<name_ ## _base_unit, unit::dimension_type, id> { \
- static const char* name() { return(name_string_); } \
- static const char* symbol() { return(symbol_string_); } \
+ static BOOST_CONSTEXPR const char* name() { return(name_string_); } \
+ static BOOST_CONSTEXPR const char* symbol() { return(symbol_string_); } \
}; \
} \
} \
@@ -170,6 +170,7 @@ BOOST_UNITS_DEFAULT_CONVERSION(namespace_::name_ ## _base_unit, unit)
/// Find the conversion factor between two units.
template<class FromUnit,class ToUnit>
inline
+BOOST_CONSTEXPR
typename one_to_double_type<
typename detail::conversion_factor_helper<FromUnit, ToUnit>::type
>::type