mirror of
https://github.com/boostorg/core.git
synced 2025-07-31 13:27:29 +02:00
Update bool constant
This commit is contained in:
@ -241,7 +241,7 @@ namespace detail {
|
|||||||
template<bool V>
|
template<bool V>
|
||||||
struct alloc_bool {
|
struct alloc_bool {
|
||||||
typedef bool value_type;
|
typedef bool value_type;
|
||||||
typedef alloc_bool<V> type;
|
typedef alloc_bool type;
|
||||||
|
|
||||||
static const bool value = V;
|
static const bool value = V;
|
||||||
|
|
||||||
|
@ -19,21 +19,25 @@ BOOST_NORETURN void throw_exception(const std::exception&);
|
|||||||
|
|
||||||
namespace default_ {
|
namespace default_ {
|
||||||
|
|
||||||
struct true_type {
|
template<bool V>
|
||||||
|
struct bool_constant {
|
||||||
typedef bool value_type;
|
typedef bool value_type;
|
||||||
typedef true_type type;
|
typedef bool_constant type;
|
||||||
|
|
||||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
static const bool value = V;
|
||||||
|
|
||||||
BOOST_CONSTEXPR operator bool() const BOOST_NOEXCEPT {
|
operator bool() const BOOST_NOEXCEPT {
|
||||||
return true;
|
return V;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_CONSTEXPR bool operator()() const BOOST_NOEXCEPT {
|
bool operator()() const BOOST_NOEXCEPT {
|
||||||
return true;
|
return V;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<bool V>
|
||||||
|
const bool bool_constant<V>::value;
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
struct add_reference {
|
struct add_reference {
|
||||||
typedef T& type;
|
typedef T& type;
|
||||||
@ -58,8 +62,8 @@ struct default_allocator {
|
|||||||
typedef typename add_reference<const T>::type const_reference;
|
typedef typename add_reference<const T>::type const_reference;
|
||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
typedef std::ptrdiff_t difference_type;
|
typedef std::ptrdiff_t difference_type;
|
||||||
typedef true_type propagate_on_container_move_assignment;
|
typedef bool_constant<true> propagate_on_container_move_assignment;
|
||||||
typedef true_type is_always_equal;
|
typedef bool_constant<true> is_always_equal;
|
||||||
|
|
||||||
template<class U>
|
template<class U>
|
||||||
struct rebind {
|
struct rebind {
|
||||||
|
Reference in New Issue
Block a user