12 #include <type_traits>
17 inline namespace v_100 {
28 template <
typename U,
bool (U::*)(block &,
size_t) noexcept>
struct Check;
30 template <
typename U>
static constexpr
bool test(...) {
return false; }
32 static constexpr
bool value = test<T>(
nullptr);
42 template <
typename U,
void (U::*)()noexcept>
struct Check;
44 template <
typename U>
static bool test(...) {
return false; }
46 static constexpr
bool value = test<T>(
nullptr);
56 template <
typename U,
bool (U::*)(const block &) const noexcept>
struct Check;
57 template <
typename U>
static constexpr
bool test(
Check<U, &U::owns> *) {
return true; }
58 template <
typename U>
static constexpr
bool test(...) {
return false; }
60 static constexpr
bool value = test<T>(
nullptr);
81 template <
template <
size_t>
class Allocator,
size_t P1,
size_t P2>
85 template <
template <
size_t,
size_t>
class Allocator,
size_t P1,
size_t P2,
size_t P3,
size_t P4>
86 struct both_same_base<Allocator<P1, P2>, Allocator<P3, P4>> : std::true_type {
89 template <
template <
size_t,
size_t,
size_t>
class Allocator,
size_t P1,
size_t P2,
size_t P3,
90 size_t P4,
size_t P5,
size_t P6>
91 struct both_same_base<Allocator<P1, P2, P3>, Allocator<P4, P5, P6>> : std::true_type {
94 template <
template <
size_t,
size_t,
size_t,
size_t>
class Allocator,
size_t P1,
size_t P2,
95 size_t P3,
size_t P4,
size_t P5,
size_t P6,
size_t P7,
size_t P8>
96 struct both_same_base<Allocator<P1, P2, P3, P4>, Allocator<P5, P6, P7, P8>> : std::true_type {
99 template <
template <
class>
class Allocator,
class A1,
class A2>
103 template <
template <
class,
size_t>
class Allocator,
class A1,
size_t P1,
class A2,
size_t P2>
107 template <
template <
class,
size_t,
size_t>
class Allocator,
class A1,
size_t P1,
size_t P2,
108 class A2,
size_t P3,
size_t P4>
109 struct both_same_base<Allocator<A1, P1, P2>, Allocator<A2, P3, P4>> : std::true_type {
112 template <
template <
class,
size_t,
size_t,
size_t>
class Allocator,
class A1,
size_t P1,
113 size_t P2,
size_t P3,
class A2,
size_t P4,
size_t P5,
size_t P6>
114 struct both_same_base<Allocator<A1, P1, P2, P3>, Allocator<A2, P4, P5, P6>> : std::true_type {
117 template <
template <
class,
size_t,
size_t,
size_t,
size_t>
class Allocator,
class A1,
size_t P1,
118 size_t P2,
size_t P3,
size_t P4,
class A2,
size_t P5,
size_t P6,
size_t P7,
size_t P8>
119 struct both_same_base<Allocator<A1, P1, P2, P3, P4>, Allocator<A2, P5, P6, P7, P8>>
129 template <
class Allocator,
typename Enabled =
void>
struct Expander;
131 template <
class Allocator>
132 struct Expander<Allocator, typename std::enable_if<has_expand<Allocator>::value>::type> {
133 static bool do_it(Allocator &a,
block &b,
size_t delta) noexcept
135 return a.expand(b, delta);
139 template <
class Allocator>
140 struct Expander<Allocator, typename std::enable_if<!has_expand<Allocator>::value>::type> {
141 static bool do_it(Allocator &,
block &,
size_t) noexcept
155 template <
class Allocator>
157 typename std::enable_if<has_deallocate_all<Allocator>::value>::type> {
158 static void do_it(Allocator &a) noexcept
164 template <
class Allocator>
166 typename std::enable_if<!has_deallocate_all<Allocator>::value>::type> {
167 static void do_it(Allocator &) noexcept
192 using namespace v_100;