mirror of
https://github.com/boostorg/core.git
synced 2025-11-29 13:50:10 +01:00
Add detection support for single argument construct and destroy
This commit is contained in:
@@ -26,6 +26,16 @@ struct A2 {
|
||||
};
|
||||
#endif
|
||||
|
||||
template<class T>
|
||||
struct A3 {
|
||||
typedef T value_type;
|
||||
A3() { }
|
||||
template<class U>
|
||||
void construct(U* p) {
|
||||
::new((void*)p) U(1);
|
||||
}
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
@@ -42,5 +52,11 @@ int main()
|
||||
BOOST_TEST_EQ(i, 6);
|
||||
}
|
||||
#endif
|
||||
{
|
||||
A3<int> a;
|
||||
int i = 0;
|
||||
boost::allocator_construct(a, &i);
|
||||
BOOST_TEST_EQ(i, 1);
|
||||
}
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user