// 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>
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
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
{
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 ||
// 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 >
>