]> git.lyx.org Git - lyx.git/blobdiff - 3rdparty/boost/boost/lexical_cast/try_lexical_convert.hpp
Update to boost 1.72
[lyx.git] / 3rdparty / boost / boost / lexical_cast / try_lexical_convert.hpp
index b079fd42aec55fab4da565b71d3c6c007aea5e28..ac2e4f3cfc47254cf868e3f8f6f37c1b7aeaa550 100644 (file)
@@ -1,6 +1,6 @@
 // Copyright Kevlin Henney, 2000-2005.
 // Copyright Alexander Nasonov, 2006-2010.
-// Copyright Antony Polukhin, 2011-2016.
+// Copyright Antony Polukhin, 2011-2019.
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
     (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)))
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wuninitialized"
+#pragma GCC diagnostic ignored "-Wsign-conversion"
 #endif
 
+
 #include <string>
-#include <boost/mpl/bool.hpp>
-#include <boost/mpl/identity.hpp>
-#include <boost/mpl/if.hpp>
+#include <boost/type_traits/is_integral.hpp>
+#include <boost/type_traits/type_identity.hpp>
+#include <boost/type_traits/conditional.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/is_arithmetic.hpp>
 
@@ -72,8 +74,9 @@ namespace boost {
         template<typename Target, typename Source>
         struct is_arithmetic_and_not_xchars
         {
-            typedef boost::mpl::bool_<
-                    !(boost::detail::is_character<Target>::value) &&
+            typedef boost::integral_constant<
+                bool,
+                !(boost::detail::is_character<Target>::value) &&
                     !(boost::detail::is_character<Source>::value) &&
                     boost::is_arithmetic<Source>::value &&
                     boost::is_arithmetic<Target>::value
@@ -91,8 +94,9 @@ namespace boost {
         template<typename Target, typename Source>
         struct is_xchar_to_xchar 
         {
-            typedef boost::mpl::bool_<
-                     sizeof(Source) == sizeof(Target) &&
+            typedef boost::integral_constant<
+                bool,
+                sizeof(Source) == sizeof(Target) &&
                      sizeof(Source) == sizeof(char) &&
                      boost::detail::is_character<Target>::value &&
                      boost::detail::is_character<Source>::value
@@ -162,7 +166,8 @@ namespace boost {
         {
             typedef BOOST_DEDUCED_TYPENAME boost::detail::array_to_pointer_decay<Source>::type src;
 
-            typedef boost::mpl::bool_<
+            typedef boost::integral_constant<
+                bool,
                 boost::detail::is_xchar_to_xchar<Target, src >::value ||
                 boost::detail::is_char_array_to_stdstring<Target, src >::value ||
                 boost::detail::is_char_array_to_booststring<Target, src >::value ||
@@ -181,11 +186,11 @@ namespace boost {
 
             // We do evaluate second `if_` lazily to avoid unnecessary instantiations
             // of `shall_we_copy_with_dynamic_check_t` and improve compilation times.
-            typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_c<
+            typedef BOOST_DEDUCED_TYPENAME boost::conditional<
                 shall_we_copy_t::value,
-                boost::mpl::identity<boost::detail::copy_converter_impl<Target, src > >,
-                boost::mpl::if_<
-                     shall_we_copy_with_dynamic_check_t,
+                boost::type_identity<boost::detail::copy_converter_impl<Target, src > >,
+                boost::conditional<
+                     shall_we_copy_with_dynamic_check_t::value,
                      boost::detail::dynamic_num_converter_impl<Target, src >,
                      boost::detail::lexical_converter_impl<Target, src >
                 >