MCPcopy Create free account
hub / github.com/Naios/function2 / no_allocate_allocator

Class no_allocate_allocator

test/regressions.cpp:74–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72
73template <typename T>
74struct no_allocate_allocator {
75 using value_type = T;
76 using size_type = size_t;
77 using pointer = value_type*;
78 using const_pointer = const value_type*;
79
80 no_allocate_allocator() = default;
81 template <typename O>
82 no_allocate_allocator(no_allocate_allocator<O>) {
83 }
84
85 template <typename M>
86 struct rebind {
87 typedef no_allocate_allocator<M> other;
88 };
89
90 pointer allocate(size_type, void const* = nullptr) {
91 EXPECT_TRUE(false);
92 return nullptr;
93 }
94
95 void deallocate(pointer, size_type) {
96 FAIL();
97 }
98};
99
100TEST(regression_tests, can_take_capacity_obj) {
101 fu2::function_base<true, true, fu2::capacity_can_hold<trash_obj>, false, true,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected