mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-11-02 08:41:45 +01:00
Remove uses of BOOST_NO_CXX11_RVALUE_REFERENCES
This commit is contained in:
@@ -14,8 +14,6 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <utility>
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
namespace N
|
||||
{
|
||||
|
||||
@@ -245,12 +243,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#else // defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -407,8 +407,6 @@ static void copy_constructor()
|
||||
|
||||
// move constructor
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
template<class T> static void empty_move_test()
|
||||
{
|
||||
boost::local_shared_ptr<T> p2(( boost::local_shared_ptr<T>() ));
|
||||
@@ -489,14 +487,6 @@ static void move_constructor()
|
||||
BOOST_TEST( X::instances == 0 );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void move_constructor()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// aliasing constructor
|
||||
|
||||
template<class T, class U> void test_aliasing_( boost::local_shared_ptr<T> const & p1, U * p2 )
|
||||
@@ -720,8 +710,6 @@ static void shared_ptr_copy_constructor()
|
||||
|
||||
// shared_ptr_move constructor
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
template<class T> static void empty_shared_ptr_move_test()
|
||||
{
|
||||
boost::local_shared_ptr<T> p2(( boost::shared_ptr<T>() ));
|
||||
@@ -801,18 +789,8 @@ static void shared_ptr_move_constructor()
|
||||
BOOST_TEST( X::instances == 0 );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void shared_ptr_move_constructor()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// unique_ptr_constructor
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
template<class T, class U> static void test_null_unique_ptr( std::unique_ptr<U> && p1 )
|
||||
{
|
||||
boost::local_shared_ptr<T> p2( std::move( p1 ) );
|
||||
@@ -914,14 +892,6 @@ static void unique_ptr_constructor()
|
||||
deleter_unique_ptr_test<void>();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void unique_ptr_constructor()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// copy assignment
|
||||
|
||||
template<class T> static void empty_copy_assign_test()
|
||||
@@ -1079,8 +1049,6 @@ static void copy_assignment()
|
||||
|
||||
// move assignment
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
template<class T> static void empty_move_assign_test()
|
||||
{
|
||||
boost::local_shared_ptr<T> p2;
|
||||
@@ -1219,14 +1187,6 @@ static void move_assignment()
|
||||
BOOST_TEST( X::instances == 0 );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void move_assignment()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// nullptr assignment
|
||||
|
||||
template<class T> static void test_nullptr_assign( boost::local_shared_ptr<T> p1 )
|
||||
@@ -1494,8 +1454,6 @@ static void shared_ptr_copy_assignment()
|
||||
|
||||
// shared_ptr_move assignment
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
template<class T> static void empty_shared_ptr_move_assign_test()
|
||||
{
|
||||
boost::local_shared_ptr<T> p2;
|
||||
@@ -1639,18 +1597,8 @@ static void shared_ptr_move_assignment()
|
||||
BOOST_TEST( X::instances == 0 );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void shared_ptr_move_assignment()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// unique_ptr assignment
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) && !defined( BOOST_NO_CXX11_SMART_PTR )
|
||||
|
||||
template<class T> static void empty_unique_ptr_assign_test()
|
||||
{
|
||||
boost::local_shared_ptr<T> p2;
|
||||
@@ -1791,14 +1739,6 @@ static void unique_ptr_assignment()
|
||||
BOOST_TEST( X::instances == 0 );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void unique_ptr_assignment()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// pointer reset
|
||||
|
||||
template<class T, class U> static void test_pointer_reset( boost::local_shared_ptr<U> p2 )
|
||||
|
||||
@@ -194,8 +194,6 @@ int main()
|
||||
BOOST_TEST( wp5.lock() == 0 );
|
||||
}
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
{
|
||||
std::unique_ptr<X[]> px( new X[ 4 ] );
|
||||
BOOST_TEST( X::allocations == 1 );
|
||||
@@ -255,8 +253,6 @@ int main()
|
||||
BOOST_TEST( X::instances == 0 );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
{
|
||||
boost::local_shared_ptr<X[]> px( new X[ 5 ], array_deleter< X >() );
|
||||
BOOST_TEST( X::allocations == 1 );
|
||||
|
||||
@@ -64,13 +64,11 @@ int main()
|
||||
boost::shared_ptr< ByRef > x = boost::make_shared< ByRef >(boost::move(a));
|
||||
BOOST_TEST( x->constructed_by_ == ByRef::move_constructor);
|
||||
}
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
{
|
||||
boost::shared_ptr< ByVal > x = boost::make_shared< ByVal >(movearg());
|
||||
boost::shared_ptr< ByRef > y = boost::make_shared< ByRef >(movearg());
|
||||
BOOST_TEST( y->constructed_by_ == ByRef::move_constructor);
|
||||
}
|
||||
#endif // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
{
|
||||
const movearg ca;
|
||||
boost::shared_ptr< ByRef > x = boost::make_shared< ByRef >(ca);
|
||||
|
||||
@@ -12,15 +12,6 @@
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#if defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
class myarg
|
||||
{
|
||||
public:
|
||||
@@ -94,5 +85,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#include <boost/config.hpp>
|
||||
|
||||
// shared_ptr_alias_move_test.cpp
|
||||
//
|
||||
// Copyright (c) 2007 Peter Dimov
|
||||
@@ -8,13 +6,11 @@
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <utility>
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
class incomplete;
|
||||
|
||||
struct X
|
||||
@@ -244,12 +240,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#else // defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <utility>
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
struct X
|
||||
{
|
||||
static long instances;
|
||||
@@ -96,12 +94,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#else // defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
struct X
|
||||
{};
|
||||
|
||||
@@ -95,12 +93,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#else // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
@@ -194,8 +194,6 @@ int main()
|
||||
BOOST_TEST( wp5.lock() == 0 );
|
||||
}
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
{
|
||||
std::unique_ptr<X[]> px( new X[ 4 ] );
|
||||
BOOST_TEST( X::allocations == 1 );
|
||||
@@ -255,8 +253,6 @@ int main()
|
||||
BOOST_TEST( X::instances == 0 );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
{
|
||||
boost::shared_ptr<X[]> px( new X[ 5 ], array_deleter< X >() );
|
||||
BOOST_TEST( X::allocations == 1 );
|
||||
|
||||
@@ -9,13 +9,6 @@
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#if defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_NO_CXX11_RVALUE_REFERENCES is defined")
|
||||
int main() {}
|
||||
|
||||
#else
|
||||
|
||||
struct Y
|
||||
{
|
||||
static int instances;
|
||||
@@ -145,5 +138,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
struct X: public boost::enable_shared_from_this< X >
|
||||
{
|
||||
static int instances;
|
||||
@@ -283,12 +281,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#else // !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,23 +9,6 @@
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#if defined( BOOST_NO_CXX11_SMART_PTR )
|
||||
|
||||
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_NO_CXX11_SMART_PTR is defined")
|
||||
int main() {}
|
||||
|
||||
#elif defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_NO_CXX11_RVALUE_REFERENCES is defined")
|
||||
int main() {}
|
||||
|
||||
#elif defined(BOOST_MSVC) && BOOST_MSVC < 1700
|
||||
|
||||
BOOST_PRAGMA_MESSAGE("Skipping test because msvc-10.0 unique_ptr doesn't support move-only deleters")
|
||||
int main() {}
|
||||
|
||||
#else
|
||||
|
||||
struct Y
|
||||
{
|
||||
static int instances;
|
||||
@@ -149,5 +132,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,15 +8,13 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <memory>
|
||||
#include <cstddef>
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
class incomplete;
|
||||
|
||||
struct X
|
||||
@@ -86,12 +84,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#else // defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <utility>
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
struct X
|
||||
{
|
||||
static long instances;
|
||||
@@ -111,12 +109,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#else // defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user