16namespace sequoia::testing
18 template<
class T=
int,
class Allocator=std::allocator<
int>>
21 using allocator_type = Allocator;
41 std::ranges::swap(lhs.x, rhs.x);
44 std::vector<T, Allocator> x{};
49 return lhs.x == rhs.x;
55 return lhs.x != rhs.x;
58 template<
class Stream>
61 for(
auto i : b.x) s << i <<
' ';
66 template<
class T,
class Allocator>
73 if constexpr(with_msvc_v && (iterator_debug_level() > 0))
75 if(count > 1)
return count + 2;
82 template<
class T=
int,
class Allocator=std::allocator<
int>>
85 using allocator_type = Allocator;
105 std::ranges::swap(lhs.x, rhs.x);
108 std::vector<T, Allocator> x{};
113 return lhs.x == rhs.x;
119 return !(rhs == lhs);
122 template<
class Stream>
125 for(
auto i : b.x) s << i <<
' ';
130 template<
class T,
class Allocator>
137 if constexpr(with_msvc_v && (iterator_debug_level() > 0))
139 if(count > 1)
return count + 2;
146 template<
class T=
int,
class Allocator=std::allocator<
int>>
149 using allocator_type = Allocator;
153 inefficient_copy(std::initializer_list<T> list,
const allocator_type& a) : x(list, a) {}
159 x.reserve(other.x.size());
160 std::copy(other.x.cbegin(), other.x.cend(), std::back_inserter(x));
178 std::ranges::swap(lhs.x, rhs.x);
181 std::vector<T, Allocator> x{};
186 return lhs.x == rhs.x;
192 return !(lhs == rhs);
195 template<
class Stream>
198 for(
auto i : b.x) s << i <<
' ';
203 template<
class T=
int,
class Allocator=std::allocator<
int>>
206 using allocator_type = Allocator;
219 x.reserve(other.x.size());
220 std::copy(other.x.cbegin(), other.x.cend(), std::back_inserter(x));
233 std::ranges::swap(lhs.x, rhs.x);
236 std::vector<T, Allocator> x{};
241 return lhs.x == rhs.x;
247 return !(lhs == rhs);
250 template<
class Stream>
253 for(
auto i : b.x) s << i <<
' ';
258 template<
class T=
int,
class Allocator=std::allocator<
int>>
261 using allocator_type = Allocator;
265 inefficient_move(std::initializer_list<T> list,
const allocator_type& a) : x(list, a) {}
275 x.reserve(x.capacity() + 1);
286 std::ranges::swap(lhs.x, rhs.x);
289 std::vector<T, Allocator> x{};
294 return lhs.x == rhs.x;
300 return !(lhs == rhs);
303 template<
class Stream>
306 for(
auto i : b.x) s << i <<
' ';
311 template<
class T=
int,
class Allocator=std::allocator<
int>>
314 using allocator_type = Allocator;
330 x.reserve(x.capacity() + 1);
339 std::ranges::swap(lhs.x, rhs.x);
342 std::vector<T, Allocator> x{};
347 return lhs.x == rhs.x;
353 return !(lhs == rhs);
356 template<
class Stream>
359 for(
auto i : b.x) s << i <<
' ';
364 template<
class T=
int,
class Allocator=std::allocator<
int>>
367 using allocator_type = Allocator;
389 std::ranges::swap(x, other.x);
393 noexcept(
noexcept(lhs.swap(rhs)))
398 std::vector<T, Allocator> x{};
406 template<
class Stream>
409 for(
auto i : b.x) s << i <<
' ';
413 template<
class Stream>
428 template<
class T,
class Allocator>
435 if constexpr(with_msvc_v && (iterator_debug_level() > 0))
437 if(count)
return count + 1;
444 template<
class T =
int,
class Allocator = std::allocator<
int>>
447 using allocator_type = Allocator;
467 *
this = std::move(tmp);
476 std::ranges::swap(x, other.x);
480 noexcept(
noexcept(lhs.swap(rhs)))
485 std::vector<T, Allocator> x{};
493 template<
class Stream>
496 for(
auto i : b.x) s << i <<
' ';
500 template<
class Stream>
515 template<
class T,
bool PropagateCopy,
bool PropagateMove,
bool PropagateSwap>
523 if constexpr(with_msvc_v && (iterator_debug_level() > 0))
525 if constexpr(!PropagateCopy)
527 if(count)
return count + 2;
536 if constexpr(with_msvc_v && (iterator_debug_level() > 0))
538 if constexpr(!PropagateCopy)
540 if(count)
return count + 2;
549 if constexpr(with_msvc_v && (iterator_debug_level() > 0))
551 if(count)
return count - 1;
Helper for dealing with allocator propagation during copy assignment.
Definition: AllocationCheckersCore.hpp:73
Somewhat similar to std::allocator but logs (de)allocations via an counter which is shared upon copyi...
Definition: AllocationTestUtilities.hpp:41
Definition: AllocationCheckers.hpp:200
Definition: AllocationTestDiagnosticsUtilities.hpp:446
Definition: AllocationTestDiagnosticsUtilities.hpp:148
Definition: AllocationTestDiagnosticsUtilities.hpp:20
Definition: AllocationTestDiagnosticsUtilities.hpp:84
Definition: AllocationTestDiagnosticsUtilities.hpp:260
Definition: AllocationTestDiagnosticsUtilities.hpp:205
Definition: AllocationTestDiagnosticsUtilities.hpp:313
Definition: AllocationTestDiagnosticsUtilities.hpp:366