class DestructorCheck : public std::tr1::enable_shared_from_this <DestructorCheck>
{
public:
DestructorCheck()
{
}
~DestructorCheck()
{
shared_from_this();
}
};
BOOST_AUTO_TEST_CASE(enable_weakTests)
{
BOOST_CHECK_THROW( { DestructorCheck d; } , std::tr1::bad_weak_ptr )
BOOST_CHECK_NO_THROW( { std::tr1::shared_ptr<DestructorCheck> d = boost::make_shared<DestructorCheck>(); } )
}