diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-09-13 11:24:46 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-09-13 11:25:39 +0900 |
commit | 4fadd968fa12130524c8380f33fcfe25d4de79e5 (patch) | |
tree | fd26a490cd15388d42fc6652b3c5c13012e7f93e /boost/multiprecision/detail/number_base.hpp | |
parent | b5c87084afaef42b2d058f68091be31988a6a874 (diff) | |
download | boost-upstream/1.65.0.tar.gz boost-upstream/1.65.0.tar.bz2 boost-upstream/1.65.0.zip |
Imported Upstream version 1.65.0upstream/1.65.0
Change-Id: Icf8400b375482cb11bcf77440a6934ba360d6ba4
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/multiprecision/detail/number_base.hpp')
-rw-r--r-- | boost/multiprecision/detail/number_base.hpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/boost/multiprecision/detail/number_base.hpp b/boost/multiprecision/detail/number_base.hpp index 9b10dd82d7..ca065bb569 100644 --- a/boost/multiprecision/detail/number_base.hpp +++ b/boost/multiprecision/detail/number_base.hpp @@ -38,8 +38,9 @@ // // Thread local storage: +// Note fails on Mingw, see https://sourceforge.net/p/mingw-w64/bugs/527/ // -#if !defined(BOOST_NO_CXX11_THREAD_LOCAL) && !defined(BOOST_INTEL) +#if !defined(BOOST_NO_CXX11_THREAD_LOCAL) && !defined(BOOST_INTEL) && !defined(__MINGW32__) # define BOOST_MP_THREAD_LOCAL thread_local #else # define BOOST_MP_THREAD_LOCAL @@ -364,13 +365,22 @@ struct unmentionable typedef unmentionable* (unmentionable::*unmentionable_type)(); -template <class T> -struct expression_storage +template <class T, bool b> +struct expression_storage_base { typedef const T& type; }; template <class T> +struct expression_storage_base<T, true> +{ + typedef T type; +}; + +template <class T> +struct expression_storage : public expression_storage_base<T, boost::is_arithmetic<T>::value> {}; + +template <class T> struct expression_storage<T*> { typedef T* type; @@ -988,6 +998,19 @@ template <class Backend, expression_template_option ExpressionTemplates> struct number_category<number<Backend, ExpressionTemplates> > : public number_category<Backend>{}; template <class tag, class A1, class A2, class A3, class A4> struct number_category<detail::expression<tag, A1, A2, A3, A4> > : public number_category<typename detail::expression<tag, A1, A2, A3, A4>::result_type>{}; +// +// Specializations for types which do not always have numberic_limits specializations: +// +#ifdef BOOST_HAS_INT128 +template <> +struct number_category<__int128> : public mpl::int_<number_kind_integer> {}; +template <> +struct number_category<unsigned __int128> : public mpl::int_<number_kind_integer> {}; +#endif +#ifdef BOOST_HAS_FLOAT128 +template <> +struct number_category<__float128> : public mpl::int_<number_kind_floating_point> {}; +#endif template <class T> struct component_type; |