30 #ifndef BIT_MEMORY_CONCEPTS_ALLOCATOR_STORAGE_HPP 31 #define BIT_MEMORY_CONCEPTS_ALLOCATOR_STORAGE_HPP 33 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 35 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 37 #include "detail/void_t.hpp" 39 #include "Allocator.hpp" 41 #include <type_traits> 93 #if __cplusplus >= 202000L 97 concept
bool AllocatorStorage = requires( T& s,
const T& cs )
99 { s.get_allocator() } ->
typename T::allocator_type&;
100 { cs.get_allocator() } ->
const typename T::allocator_type&;
101 } && std::is_nothrow_copy_constructible<T>::value &&
102 std::is_nothrow_move_constructible<T>::value &&
103 std::is_nothrow_copy_assignable<T>::value &&
104 std::is_nothrow_move_assignable<T>::value;
109 template<
typename T,
typename =
void>
110 struct is_allocator_storage_impl : std::false_type{};
113 struct is_allocator_storage_impl<T,
115 decltype(
std::declval<T&>().get_allocator() ),
116 decltype( std::declval<const T&>().get_allocator() )
118 > : std::integral_constant<bool,
119 is_allocator<typename T::allocator_type>::value &&
120 std::is_convertible<decltype( std::declval<T&>().get_allocator()),
121 typename T::allocator_type&>::value &&
122 std::is_convertible<decltype( std::declval<const T&>().get_allocator()),
123 const typename T::allocator_type&>::value &&
124 std::is_nothrow_copy_constructible<T>::value &&
125 std::is_nothrow_move_constructible<T>::value &&
126 std::is_nothrow_copy_assignable<T>::value &&
127 std::is_nothrow_move_assignable<T>::value>{};
Type trait to determine whether T is a AllocatorStorage.