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