#include <boost/test/unit_test.hpp>
#include "associative_test_data.hpp"
#include <boost/ptr_container/ptr_set.hpp>
+#include <boost/ptr_container/detail/ptr_container_disable_deprecated.hpp>
template< class SetDerived, class SetBase, class T >
void test_transfer()
BOOST_CHECK( n > 0 );
}
-
+#if defined(BOOST_PTR_CONTAINER_DISABLE_DEPRECATED)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
void test_set()
{
BOOST_CHECK_THROW( set.insert( 0 ), bad_ptr_container_operation );
set.insert( new int(0) );
+#ifndef BOOST_NO_AUTO_PTR
std::auto_ptr<int> ap( new int(1) );
set.insert( ap );
+#endif
+#ifndef BOOST_NO_CXX11_SMART_PTR
+ std::unique_ptr<int> up( new int(2) );
+ set.insert( std::move( up ) );
+#endif
BOOST_CHECK_THROW( (set.replace(set.begin(), 0 )), bad_ptr_container_operation );
+#ifndef BOOST_NO_AUTO_PTR
BOOST_CHECK_THROW( (set.replace(set.begin(), std::auto_ptr<int>(0) )), bad_ptr_container_operation );
+#endif
+#ifndef BOOST_NO_CXX11_SMART_PTR
+ BOOST_CHECK_THROW( (set.replace(set.begin(), std::unique_ptr<int>(nullptr) )), bad_ptr_container_operation );
+#endif
test_erase< ptr_set<Base> >();
test_erase< ptr_multiset<Base> >();
}
+#if defined(BOOST_PTR_CONTAINER_DISABLE_DEPRECATED)
+#pragma GCC diagnostic pop
+#endif
+
using boost::unit_test::test_suite;
test_suite* init_unit_test_suite( int argc, char* argv[] )
return test;
}
-
-
-
-
-
-