Add node-based foa containers to assign_tests

This commit is contained in:
Christian Mazakas
2023-01-30 13:55:50 -08:00
parent 03ee5d135b
commit 130b483123
3 changed files with 67 additions and 2 deletions
@@ -67,6 +67,21 @@ namespace boost {
x = nullptr;
}
template <class A>
static void construct(A& al, storage_type* p, storage_type const& copy)
{
*p = boost::to_address(boost::allocator_allocate(al, 1));
try {
boost::allocator_construct(al, *p, *copy);
} catch (...) {
boost::allocator_deallocate(al,
boost::pointer_traits<
typename boost::allocator_pointer<A>::type>::pointer_to(**p),
1);
throw;
}
}
template <class A, class... Args>
static void construct(A& al, storage_type* p, Args&&... args)
{
@@ -53,6 +53,21 @@ namespace boost {
x = nullptr;
}
template <class A, class... Args>
static void construct(A& al, storage_type* p, storage_type const& copy)
{
*p = boost::to_address(boost::allocator_allocate(al, 1));
try {
boost::allocator_construct(al, *p, *copy);
} catch (...) {
boost::allocator_deallocate(al,
boost::pointer_traits<
typename boost::allocator_pointer<A>::type>::pointer_to(**p),
1);
throw;
}
}
template <class A, class... Args>
static void construct(A& al, storage_type* p, Args&&... args)
{