update boost
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2009-2016 Vladimir Batov.
|
||||
// Copyright (c) 2009-2020 Vladimir Batov.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. See http://www.boost.org/LICENSE_1_0.txt.
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#define BOOST_CONVERT_DETAIL_IS_CHAR_HPP
|
||||
|
||||
#include <boost/convert/detail/config.hpp>
|
||||
#include <type_traits>
|
||||
#include <cctype>
|
||||
#include <cwctype>
|
||||
|
||||
@@ -15,6 +14,7 @@ namespace boost { namespace cnv
|
||||
using char_type = char;
|
||||
using uchar_type = unsigned char;
|
||||
using wchar_type = wchar_t;
|
||||
using char_cptr = char const*;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2009-2016 Vladimir Batov.
|
||||
// Copyright (c) 2009-2020 Vladimir Batov.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. See http://www.boost.org/LICENSE_1_0.txt.
|
||||
|
||||
@@ -8,26 +8,27 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/version.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#undef BOOST_CONVERT_CXX11
|
||||
#if defined(BOOST_NO_CXX14)
|
||||
#undef BOOST_CONVERT_CXX14
|
||||
#else
|
||||
#define BOOST_CONVERT_CXX11
|
||||
#define BOOST_CONVERT_CXX14
|
||||
#endif
|
||||
|
||||
// Intel 12.0 and lower have broken SFINAE
|
||||
#if defined(BOOST_INTEL) && (BOOST_INTEL <= 1200)
|
||||
# define BOOST_CONVERT_IS_NOT_SUPPORTED
|
||||
#undef BOOST_CONVERT_CXX14
|
||||
#endif
|
||||
|
||||
// No C++11 support
|
||||
#if defined(BOOST_GCC_VERSION) && (BOOST_GCC_VERSION <= 40600)
|
||||
# define BOOST_CONVERT_IS_NOT_SUPPORTED
|
||||
#if defined(__GNUC__) && (__GNUC__ < 6)
|
||||
#undef BOOST_CONVERT_CXX14
|
||||
#endif
|
||||
|
||||
// MSVC-11 and lower have broken SFINAE
|
||||
#if defined(BOOST_MSVC) && (BOOST_MSVC < 1800)
|
||||
# define BOOST_CONVERT_IS_NOT_SUPPORTED
|
||||
#if defined(_MSVC_VER) && (_MSVC_VER < 1800)
|
||||
#undef BOOST_CONVERT_CXX14
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
@@ -42,12 +43,13 @@
|
||||
//MSVC++ 14.0 _MSC_VER == 1900 (Visual Studio 2015)
|
||||
//MSVC++ 15.0 _MSC_VER == 1910 (Visual Studio 2017)
|
||||
|
||||
# pragma warning(disable: 4244)
|
||||
# pragma warning(disable: 4224)
|
||||
# pragma warning(disable: 4996)
|
||||
# pragma warning(disable: 4180) // qualifier applied to function type has no meaning
|
||||
# pragma warning(disable: 4100) // unreferenced formal parameter
|
||||
# pragma warning(disable: 4146) // unary minus operator applied to unsigned type
|
||||
# pragma warning(disable: 4180) // qualifier applied to function type has no meaning
|
||||
# pragma warning(disable: 4224)
|
||||
# pragma warning(disable: 4244)
|
||||
# pragma warning(disable: 4800) // forcing value to bool
|
||||
# pragma warning(disable: 4996)
|
||||
|
||||
#if _MSC_VER < 1900 /* MSVC-14 defines real snprintf()... just about time! */
|
||||
# define snprintf _snprintf
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2009-2016 Vladimir Batov.
|
||||
// Copyright (c) 2009-2020 Vladimir Batov.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. See http://www.boost.org/LICENSE_1_0.txt.
|
||||
|
||||
@@ -40,9 +40,9 @@
|
||||
template <typename __boost_has_member_T__> /*C4*/ \
|
||||
class __trait_name__ \
|
||||
{ \
|
||||
typedef typename boost::remove_const<__boost_has_member_T__>::type check_type; \
|
||||
typedef ::boost::type_traits::yes_type yes_type; \
|
||||
typedef ::boost::type_traits:: no_type no_type; \
|
||||
using check_type = typename boost::remove_const<__boost_has_member_T__>::type; \
|
||||
using yes_type = ::boost::type_traits::yes_type; \
|
||||
using no_type = ::boost::type_traits:: no_type; \
|
||||
\
|
||||
struct base { void __member_name__(/*C2*/) {}}; \
|
||||
struct mixin : public base, public check_type {}; \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2009-2016 Vladimir Batov.
|
||||
// Copyright (c) 2009-2020 Vladimir Batov.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. See http://www.boost.org/LICENSE_1_0.txt.
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
namespace boost { namespace cnv { namespace detail
|
||||
{
|
||||
typedef ::boost::type_traits::yes_type yes_type;
|
||||
typedef ::boost::type_traits:: no_type no_type;
|
||||
using yes_type = ::boost::type_traits::yes_type;
|
||||
using no_type = ::boost::type_traits:: no_type;
|
||||
|
||||
struct not_found {};
|
||||
struct void_return_substitute {};
|
||||
@@ -21,8 +21,8 @@ namespace boost { namespace cnv { namespace detail
|
||||
template<typename U> U const& operator, (U const&, void_return_substitute);
|
||||
template<typename U> U& operator, (U&, void_return_substitute);
|
||||
|
||||
template <typename src, typename dst> struct match_const { typedef dst type; };
|
||||
template <typename src, typename dst> struct match_const<src const, dst> { typedef dst const type; };
|
||||
template <typename src, typename dst> struct match_const { using type = dst; };
|
||||
template <typename src, typename dst> struct match_const<src const, dst> { using type = dst const; };
|
||||
|
||||
template<typename T, typename return_type>
|
||||
struct redirect
|
||||
@@ -53,48 +53,49 @@ namespace boost { namespace cnv { namespace detail
|
||||
template <typename __boost_is_callable_T__, typename __boost_is_callable_signature__> \
|
||||
class __trait_name__ \
|
||||
{ \
|
||||
typedef __boost_is_callable_T__ class_type; /*C1*/ \
|
||||
typedef __boost_is_callable_signature__ signature; /*C1*/ \
|
||||
typedef boost::cnv::detail::not_found not_found; \
|
||||
using class_type = __boost_is_callable_T__; /*C1*/ \
|
||||
using signature = __boost_is_callable_signature__; /*C1*/ \
|
||||
using not_found = boost::cnv::detail::not_found; \
|
||||
\
|
||||
BOOST_DECLARE_HAS_MEMBER(has_member, __member_name__); \
|
||||
\
|
||||
struct mixin : public class_type \
|
||||
struct mixin : class_type \
|
||||
{ \
|
||||
using class_type::__member_name__; \
|
||||
not_found __member_name__(...) const { return not_found(); /*C2*/} \
|
||||
}; \
|
||||
\
|
||||
typedef typename boost::cnv::detail::match_const<class_type, mixin>::type* mixin_ptr; \
|
||||
using mixin_ptr = typename boost::cnv::detail::match_const<class_type, mixin>::type*; \
|
||||
\
|
||||
template <bool has, typename F> struct check { static bool const value = false; }; \
|
||||
\
|
||||
template <typename Arg1, typename R> \
|
||||
struct check<true, R (Arg1)> \
|
||||
{ \
|
||||
typedef typename boost::decay<Arg1>::type* a1; \
|
||||
using a1 = typename boost::decay<Arg1>::type*; \
|
||||
\
|
||||
static bool const value = sizeof(boost::type_traits::yes_type) \
|
||||
== sizeof(boost::cnv::detail::redirect<class_type, R>::test( \
|
||||
(mixin_ptr(0)->__member_name__(*a1(0)), \
|
||||
boost::cnv::detail::void_return_substitute()))); \
|
||||
static bool BOOST_CONSTEXPR_OR_CONST value = \
|
||||
sizeof(boost::type_traits::yes_type) == \
|
||||
sizeof(boost::cnv::detail::redirect<class_type, R>::test( \
|
||||
(mixin_ptr(0)->__member_name__(*a1(0)), \
|
||||
boost::cnv::detail::void_return_substitute()))); \
|
||||
}; \
|
||||
template <typename Arg1, typename Arg2, typename R> \
|
||||
struct check<true, R (Arg1, Arg2)> \
|
||||
{ \
|
||||
typedef typename boost::decay<Arg1>::type* a1; \
|
||||
typedef typename boost::decay<Arg2>::type* a2; \
|
||||
using a1 = typename boost::decay<Arg1>::type*; \
|
||||
using a2 = typename boost::decay<Arg2>::type*; \
|
||||
\
|
||||
static bool const value = sizeof(boost::type_traits::yes_type) \
|
||||
== sizeof(boost::cnv::detail::redirect<class_type, R>::test( \
|
||||
(mixin_ptr(0)->__member_name__(*a1(0), *a2(0)), \
|
||||
boost::cnv::detail::void_return_substitute()))); \
|
||||
static bool BOOST_CONSTEXPR_OR_CONST value = \
|
||||
sizeof(boost::type_traits::yes_type) == \
|
||||
sizeof(boost::cnv::detail::redirect<class_type, R>::test( \
|
||||
(mixin_ptr(0)->__member_name__(*a1(0), *a2(0)), \
|
||||
boost::cnv::detail::void_return_substitute()))); \
|
||||
}; \
|
||||
\
|
||||
public: \
|
||||
\
|
||||
/* Check the existence of __member_name__ first, then the signature. */ \
|
||||
static bool const value = check<has_member<class_type>::value, signature>::value; \
|
||||
static bool BOOST_CONSTEXPR_OR_CONST value = check<has_member<class_type>::value, signature>::value; \
|
||||
}
|
||||
|
||||
#endif // BOOST_CONVERT_IS_CALLABLE_HPP
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
// Copyright (c) 2009-2016 Vladimir Batov.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. See http://www.boost.org/LICENSE_1_0.txt.
|
||||
|
||||
#ifndef BOOST_CONVERT_IS_CONVERTER_HPP
|
||||
#define BOOST_CONVERT_IS_CONVERTER_HPP
|
||||
|
||||
#include <boost/convert/detail/config.hpp>
|
||||
#include <boost/convert/detail/is_callable.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <boost/ref.hpp>
|
||||
|
||||
namespace boost { namespace cnv
|
||||
{
|
||||
template<typename, typename, typename, typename =void>
|
||||
struct is_cnv { BOOST_STATIC_CONSTANT(bool, value = false); };
|
||||
|
||||
template<typename Class, typename TypeIn, typename TypeOut>
|
||||
struct is_cnv<Class, TypeIn, TypeOut, typename enable_if<is_class<Class>, void>::type>
|
||||
{
|
||||
typedef typename ::boost::unwrap_reference<Class>::type class_type;
|
||||
typedef void signature_type(TypeIn const&, optional<TypeOut>&);
|
||||
|
||||
BOOST_DECLARE_IS_CALLABLE(is_callable, operator());
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, value = (is_callable<class_type, signature_type>::value));
|
||||
};
|
||||
|
||||
template<typename Function, typename TypeIn, typename TypeOut>
|
||||
struct is_cnv<Function, TypeIn, TypeOut,
|
||||
typename enable_if_c<is_function<Function>::value && function_types::function_arity<Function>::value == 2,
|
||||
void>::type>
|
||||
{
|
||||
typedef TypeIn in_type;
|
||||
typedef optional<TypeOut>& out_type;
|
||||
typedef typename function_traits<Function>::arg1_type func_in_type;
|
||||
typedef typename function_traits<Function>::arg2_type func_out_type;
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, in_good = (is_convertible<in_type, func_in_type>::value));
|
||||
BOOST_STATIC_CONSTANT(bool, out_good = (is_same<out_type, func_out_type>::value));
|
||||
BOOST_STATIC_CONSTANT(bool, value = (in_good && out_good));
|
||||
};
|
||||
}}
|
||||
|
||||
#endif // BOOST_CONVERT_IS_CONVERTER_HPP
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2009-2016 Vladimir Batov.
|
||||
// Copyright (c) 2009-2020 Vladimir Batov.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. See http://www.boost.org/LICENSE_1_0.txt.
|
||||
|
||||
@@ -7,21 +7,19 @@
|
||||
|
||||
#include <boost/convert/detail/config.hpp>
|
||||
#include <boost/convert/detail/has_member.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <boost/function_types/is_function_pointer.hpp>
|
||||
#include <boost/function_types/function_arity.hpp>
|
||||
#include <boost/function_types/result_type.hpp>
|
||||
|
||||
namespace boost { namespace cnv
|
||||
{
|
||||
typedef ::boost::type_traits::yes_type yes_type;
|
||||
typedef ::boost::type_traits:: no_type no_type;
|
||||
using yes_type = ::boost::type_traits::yes_type;
|
||||
using no_type = ::boost::type_traits:: no_type;
|
||||
|
||||
template <bool has_operator, typename Functor, typename TypeOut>
|
||||
struct check_functor { BOOST_STATIC_CONSTANT(bool, value = false); };
|
||||
|
||||
template<typename Func, typename TypeOut, class Enable =void>
|
||||
template<typename Func, typename TypeOut, typename Enable = void>
|
||||
struct is_fun { BOOST_STATIC_CONSTANT(bool, value = false); };
|
||||
|
||||
template <typename Functor, typename TypeOut>
|
||||
@@ -30,18 +28,16 @@ namespace boost { namespace cnv
|
||||
static yes_type test (TypeOut const&);
|
||||
static no_type test (...);
|
||||
|
||||
static const bool value = sizeof(yes_type) == sizeof(test(((Functor*) 0)->operator()()));
|
||||
static bool BOOST_CONSTEXPR_OR_CONST value = sizeof(yes_type) == sizeof(test(((Functor*) 0)->operator()()));
|
||||
};
|
||||
|
||||
template<typename Functor, typename TypeOut>
|
||||
struct is_fun<Functor, TypeOut,
|
||||
typename enable_if_c<is_class<Functor>::value && !is_convertible<Functor, TypeOut>::value, void>::type>
|
||||
typename enable_if_c<std::is_class<Functor>::value && !is_convertible<Functor, TypeOut>::value, void>::type>
|
||||
{
|
||||
BOOST_DECLARE_HAS_MEMBER(has_funop, operator());
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, value = (check_functor<has_funop<Functor>::value, Functor, TypeOut>::value));
|
||||
};
|
||||
|
||||
template<typename Function, typename TypeOut>
|
||||
struct is_fun<Function, TypeOut,
|
||||
typename enable_if_c<
|
||||
@@ -50,10 +46,10 @@ namespace boost { namespace cnv
|
||||
!is_same<Function, TypeOut>::value,
|
||||
void>::type>
|
||||
{
|
||||
typedef TypeOut out_type;
|
||||
typedef typename function_types::result_type<Function>::type func_out_type;
|
||||
using out_type = TypeOut;
|
||||
using func_type = typename function_types::result_type<Function>::type;
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, value = (is_convertible<func_out_type, out_type>::value));
|
||||
BOOST_STATIC_CONSTANT(bool, value = (is_convertible<func_type, out_type>::value));
|
||||
};
|
||||
}}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2009-2016 Vladimir Batov.
|
||||
// Copyright (c) 2009-2020 Vladimir Batov.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. See http://www.boost.org/LICENSE_1_0.txt.
|
||||
|
||||
@@ -15,20 +15,22 @@ namespace boost { namespace cnv
|
||||
|
||||
template<typename T> struct is_string<T*, false>
|
||||
{
|
||||
static bool const value = cnv::is_char<T>::value;
|
||||
static bool BOOST_CONSTEXPR_OR_CONST value = cnv::is_char<T>::value;
|
||||
};
|
||||
template <typename T, std::size_t N> struct is_string<T [N], false>
|
||||
{
|
||||
static bool const value = cnv::is_char<T>::value;
|
||||
static bool BOOST_CONSTEXPR_OR_CONST value = cnv::is_char<T>::value;
|
||||
};
|
||||
template<typename T> struct is_string<T, /*is_range_class=*/true>
|
||||
{
|
||||
static bool const value = cnv::is_char<typename T::value_type>::value;
|
||||
static bool BOOST_CONSTEXPR_OR_CONST value = cnv::is_char<typename T::value_type>::value;
|
||||
};
|
||||
}
|
||||
template<typename T> struct is_string : detail::is_string<
|
||||
typename boost::remove_const<T>::type,
|
||||
boost::is_class<T>::value && boost::cnv::is_range<T>::value> {};
|
||||
template<typename T>
|
||||
struct is_string : detail::is_string<
|
||||
typename std::remove_const<T>::type,
|
||||
std::is_class<T>::value && cnv::is_range<T>::value>
|
||||
{};
|
||||
}}
|
||||
|
||||
#endif // BOOST_CONVERT_DETAIL_IS_STRING_HPP
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2009-2016 Vladimir Batov.
|
||||
// Copyright (c) 2009-2020 Vladimir Batov.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. See http://www.boost.org/LICENSE_1_0.txt.
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#include <boost/convert/detail/has_member.hpp>
|
||||
#include <boost/convert/detail/char.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/range/iterator.hpp>
|
||||
|
||||
namespace boost { namespace cnv
|
||||
@@ -21,7 +20,7 @@ namespace boost { namespace cnv
|
||||
BOOST_DECLARE_HAS_MEMBER(has_begin, begin);
|
||||
BOOST_DECLARE_HAS_MEMBER( has_end, end);
|
||||
|
||||
static bool const value = has_begin<T>::value && has_end<T>::value;
|
||||
static bool BOOST_CONSTEXPR_OR_CONST value = has_begin<T>::value && has_end<T>::value;
|
||||
};
|
||||
}
|
||||
template<typename T> struct is_range : detail::is_range<typename boost::remove_const<T>::type, boost::is_class<T>::value> {};
|
||||
@@ -29,26 +28,26 @@ namespace boost { namespace cnv
|
||||
template<typename T, typename enable =void> struct iterator;
|
||||
|
||||
template<typename T>
|
||||
struct iterator<T, typename enable_if<is_range<T> >::type>
|
||||
struct iterator<T, typename std::enable_if<is_range<T>::value>::type>
|
||||
{
|
||||
typedef typename boost::range_iterator<T>::type type;
|
||||
typedef typename boost::range_iterator<T const>::type const_type;
|
||||
typedef typename boost::iterator_value<type>::type value_type;
|
||||
using type = typename boost::range_iterator<T>::type;
|
||||
using const_type = typename boost::range_iterator<T const>::type;
|
||||
using value_type = typename boost::iterator_value<type>::type;
|
||||
};
|
||||
template<typename T>
|
||||
struct iterator<T*, void>
|
||||
{
|
||||
typedef typename boost::remove_const<T>::type value_type;
|
||||
typedef T* type;
|
||||
typedef value_type const* const_type;
|
||||
using value_type = typename boost::remove_const<T>::type;
|
||||
using type = T*;
|
||||
using const_type = value_type const*;
|
||||
};
|
||||
template<typename T>
|
||||
struct range_base
|
||||
{
|
||||
typedef typename cnv::iterator<T>::value_type value_type;
|
||||
typedef typename cnv::iterator<T>::type iterator;
|
||||
typedef typename cnv::iterator<T>::const_type const_iterator;
|
||||
typedef const_iterator sentry_type;
|
||||
using value_type = typename cnv::iterator<T>::value_type;
|
||||
using iterator = typename cnv::iterator<T>::type;
|
||||
using const_iterator = typename cnv::iterator<T>::const_type;
|
||||
using sentry_type = const_iterator;
|
||||
|
||||
iterator begin () { return begin_; }
|
||||
const_iterator begin () const { return begin_; }
|
||||
@@ -64,17 +63,17 @@ namespace boost { namespace cnv
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct range<T, typename enable_if<is_range<T> >::type> : public range_base<T>
|
||||
struct range<T, typename std::enable_if<is_range<T>::value>::type> : public range_base<T>
|
||||
{
|
||||
typedef range this_type;
|
||||
typedef range_base<T> base_type;
|
||||
typedef typename base_type::iterator iterator;
|
||||
typedef typename base_type::const_iterator const_iterator;
|
||||
typedef const_iterator sentry_type;
|
||||
using this_type = range;
|
||||
using base_type = range_base<T>;
|
||||
using iterator = typename base_type::iterator;
|
||||
using const_iterator = typename base_type::const_iterator;
|
||||
using sentry_type = const_iterator;
|
||||
|
||||
range (T& r) : base_type(r.begin(), r.end()) {}
|
||||
|
||||
iterator end () { return base_type::end_; }
|
||||
iterator end () { return base_type::end_; }
|
||||
const_iterator end () const { return base_type::end_; }
|
||||
sentry_type sentry () const { return base_type::end_; }
|
||||
std::size_t size () const { return base_type::end_ - base_type::begin_; }
|
||||
@@ -82,7 +81,7 @@ namespace boost { namespace cnv
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct range<T*, typename enable_if<cnv::is_char<T> >::type> : public range_base<T*>
|
||||
struct range<T*, typename std::enable_if<cnv::is_char<T>::value>::type> : public range_base<T*>
|
||||
{
|
||||
using this_type = range;
|
||||
using base_type = range_base<T*>;
|
||||
|
||||
Reference in New Issue
Block a user