Enable move-only deleters in the nullptr_t constructors

This commit is contained in:
Peter Dimov
2021-05-11 02:15:27 +03:00
parent b52d7548b3
commit fec5fb97c8
2 changed files with 42 additions and 0 deletions

View File

@@ -125,6 +125,28 @@ int main()
BOOST_TEST( Y::instances == 0 );
}
#if !defined( BOOST_NO_CXX11_NULLPTR )
{
boost::shared_ptr<Y> p( nullptr, YD() );
YD del;
p = boost::shared_ptr<Y>( nullptr, std::move( del ) );
BOOST_TEST( del.moved_ );
}
{
boost::shared_ptr<Y> p( nullptr, YD(), std::allocator<Y>() );
YD del;
p = boost::shared_ptr<Y>( nullptr, std::move( del ), std::allocator<Y>() );
BOOST_TEST( del.moved_ );
}
#endif
return boost::report_errors();
}