Use a different workaround for supporting noinit_adaptor in C++03

This commit is contained in:
Glen Fernandes
2022-03-15 11:58:38 -04:00
parent 4defdfd233
commit 5e0ff1680f
5 changed files with 72 additions and 68 deletions

View File

@@ -29,6 +29,7 @@ struct A1 {
A1() { }
};
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
template<class T>
struct A2 {
typedef T value_type;
@@ -38,6 +39,7 @@ struct A2 {
*p = U();
}
};
#endif
int main()
{
@@ -48,11 +50,13 @@ int main()
BOOST_TEST_EQ(S::count, 0);
::new((void*)&s) S();
}
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
{
A2<int> a;
int i = 5;
boost::allocator_destroy(a, &i);
BOOST_TEST_EQ(i, 0);
}
#endif
return boost::report_errors();
}