mirror of
https://github.com/boostorg/core.git
synced 2025-07-30 04:47:24 +02:00
Use BOOST_NO_CXX11_POINTER_TRAITS macro
This commit is contained in:
@ -9,9 +9,7 @@ Distributed under the Boost Software License, Version 1.0.
|
|||||||
#define BOOST_CORE_POINTER_TRAITS_HPP
|
#define BOOST_CORE_POINTER_TRAITS_HPP
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/detail/workaround.hpp>
|
#if !defined(BOOST_NO_CXX11_POINTER_TRAITS)
|
||||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR) && \
|
|
||||||
!BOOST_WORKAROUND(BOOST_MSVC, < 1910)
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#else
|
#else
|
||||||
#include <boost/core/addressof.hpp>
|
#include <boost/core/addressof.hpp>
|
||||||
@ -33,8 +31,7 @@ ptr_traits_address(U v) BOOST_NOEXCEPT
|
|||||||
|
|
||||||
} /* detail */
|
} /* detail */
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR) && \
|
#if !defined(BOOST_NO_CXX11_POINTER_TRAITS)
|
||||||
!BOOST_WORKAROUND(BOOST_MSVC, < 1910)
|
|
||||||
template<class T>
|
template<class T>
|
||||||
struct pointer_traits
|
struct pointer_traits
|
||||||
: std::pointer_traits<T> {
|
: std::pointer_traits<T> {
|
||||||
@ -72,7 +69,7 @@ private:
|
|||||||
template<class U>
|
template<class U>
|
||||||
static char call(typename U::element_type* = 0);
|
static char call(typename U::element_type* = 0);
|
||||||
public:
|
public:
|
||||||
BOOST_STATIC_CONSTEXPR bool value = sizeof(call<T>(0)) == 1;
|
static const bool value = sizeof(call<T>(0)) == 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
@ -118,7 +115,7 @@ private:
|
|||||||
template<class U>
|
template<class U>
|
||||||
static char call(typename U::difference_type* = 0);
|
static char call(typename U::difference_type* = 0);
|
||||||
public:
|
public:
|
||||||
BOOST_STATIC_CONSTEXPR bool value = sizeof(call<T>(0)) == 1;
|
static const bool value = sizeof(call<T>(0)) == 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T, bool = ptr_traits_has_difference<T>::value>
|
template<class T, bool = ptr_traits_has_difference<T>::value>
|
||||||
@ -139,7 +136,7 @@ private:
|
|||||||
template<class U>
|
template<class U>
|
||||||
static char call(typename U::template rebind<V>* = 0);
|
static char call(typename U::template rebind<V>* = 0);
|
||||||
public:
|
public:
|
||||||
BOOST_STATIC_CONSTEXPR bool value = sizeof(call<T>(0)) == 1;
|
static const bool value = sizeof(call<T>(0)) == 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T, class V>
|
template<class T, class V>
|
||||||
|
Reference in New Issue
Block a user