From b4a0629b634afbcf211b3029f5b625e444be3e5c Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 25 Sep 2024 03:04:27 +0300 Subject: [PATCH] Remove uses of BOOST_NO_CXX11_VARIADIC_TEMPLATES --- include/boost/smart_ptr/allocate_unique.hpp | 2 - .../boost/smart_ptr/make_shared_object.hpp | 498 +----------------- include/boost/smart_ptr/make_unique.hpp | 2 - ...cate_local_shared_array_construct_test.cpp | 13 +- .../allocate_local_shared_array_esft_test.cpp | 14 +- ...llocate_local_shared_array_noinit_test.cpp | 14 +- test/allocate_local_shared_array_test.cpp | 14 +- ...llocate_local_shared_array_throws_test.cpp | 12 +- ...allocate_local_shared_array_value_test.cpp | 12 +- test/allocate_local_shared_arrays_test.cpp | 13 +- test/allocate_local_shared_esft_test.cpp | 15 +- test/allocate_local_shared_test.cpp | 15 +- test/get_local_deleter_array_test2.cpp | 13 +- test/get_local_deleter_test3.cpp | 13 +- test/make_local_shared_array_esft_test.cpp | 14 +- test/make_local_shared_array_noinit_test.cpp | 14 +- test/make_local_shared_array_test.cpp | 14 +- test/make_local_shared_array_throws_test.cpp | 12 +- test/make_local_shared_array_value_test.cpp | 12 +- test/make_local_shared_arrays_test.cpp | 13 +- test/make_local_shared_const_test.cpp | 15 +- test/make_local_shared_esft_test.cpp | 15 +- test/make_local_shared_test.cpp | 15 +- test/make_unique_args_test.cpp | 3 +- 24 files changed, 46 insertions(+), 731 deletions(-) diff --git a/include/boost/smart_ptr/allocate_unique.hpp b/include/boost/smart_ptr/allocate_unique.hpp index 25b37ad..ca84050 100644 --- a/include/boost/smart_ptr/allocate_unique.hpp +++ b/include/boost/smart_ptr/allocate_unique.hpp @@ -372,7 +372,6 @@ allocate_unique(const A& alloc) return c.release(); } -#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) template inline typename enable_if_::value, std::unique_ptr > >::type @@ -382,7 +381,6 @@ allocate_unique(const A& alloc, Args&&... args) boost::alloc_construct(c.state(), c.get(), std::forward(args)...); return c.release(); } -#endif template inline typename enable_if_::value, diff --git a/include/boost/smart_ptr/make_shared_object.hpp b/include/boost/smart_ptr/make_shared_object.hpp index 6fbf297..52709bc 100644 --- a/include/boost/smart_ptr/make_shared_object.hpp +++ b/include/boost/smart_ptr/make_shared_object.hpp @@ -13,8 +13,6 @@ #include #include -#include -#include #include #include #include @@ -229,9 +227,7 @@ template< class T, class A > typename boost::detail::sp_if_not_array< T >::type return boost::shared_ptr< T >( pt, pt2 ); } -#if !defined( BOOST_NO_CXX11_VARIADIC_TEMPLATES ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - -// Variadic templates, rvalue reference +// template< class T, class... Args > typename boost::detail::sp_if_not_array< T >::type make_shared( Args && ... args ) { @@ -290,498 +286,6 @@ template< class T, class A, class... Args > typename boost::detail::sp_if_not_ar return boost::shared_ptr< T >( pt, pt2 ); } -#else // !defined( BOOST_NO_CXX11_VARIADIC_TEMPLATES ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - -// Common zero-argument versions - -template< class T > typename boost::detail::sp_if_not_array< T >::type make_shared() -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T(); - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T(); - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -// C++03 version - -template< class T, class A1 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A, class A1 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A1, class A2 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ), - boost::forward( a2 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A, class A1, class A2 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ), - boost::forward( a2 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A1, class A2, class A3 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ), - boost::forward( a2 ), - boost::forward( a3 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A, class A1, class A2, class A3 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ), - boost::forward( a2 ), - boost::forward( a3 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A1, class A2, class A3, class A4 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ), - boost::forward( a2 ), - boost::forward( a3 ), - boost::forward( a4 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A, class A1, class A2, class A3, class A4 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ), - boost::forward( a2 ), - boost::forward( a3 ), - boost::forward( a4 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A1, class A2, class A3, class A4, class A5 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ), - boost::forward( a2 ), - boost::forward( a3 ), - boost::forward( a4 ), - boost::forward( a5 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A, class A1, class A2, class A3, class A4, class A5 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ), - boost::forward( a2 ), - boost::forward( a3 ), - boost::forward( a4 ), - boost::forward( a5 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A1, class A2, class A3, class A4, class A5, class A6 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5, BOOST_FWD_REF(A6) a6 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ), - boost::forward( a2 ), - boost::forward( a3 ), - boost::forward( a4 ), - boost::forward( a5 ), - boost::forward( a6 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5, BOOST_FWD_REF(A6) a6 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ), - boost::forward( a2 ), - boost::forward( a3 ), - boost::forward( a4 ), - boost::forward( a5 ), - boost::forward( a6 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5, BOOST_FWD_REF(A6) a6, BOOST_FWD_REF(A7) a7 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ), - boost::forward( a2 ), - boost::forward( a3 ), - boost::forward( a4 ), - boost::forward( a5 ), - boost::forward( a6 ), - boost::forward( a7 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5, BOOST_FWD_REF(A6) a6, BOOST_FWD_REF(A7) a7 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ), - boost::forward( a2 ), - boost::forward( a3 ), - boost::forward( a4 ), - boost::forward( a5 ), - boost::forward( a6 ), - boost::forward( a7 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5, BOOST_FWD_REF(A6) a6, BOOST_FWD_REF(A7) a7, BOOST_FWD_REF(A8) a8 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ), - boost::forward( a2 ), - boost::forward( a3 ), - boost::forward( a4 ), - boost::forward( a5 ), - boost::forward( a6 ), - boost::forward( a7 ), - boost::forward( a8 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5, BOOST_FWD_REF(A6) a6, BOOST_FWD_REF(A7) a7, BOOST_FWD_REF(A8) a8 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ), - boost::forward( a2 ), - boost::forward( a3 ), - boost::forward( a4 ), - boost::forward( a5 ), - boost::forward( a6 ), - boost::forward( a7 ), - boost::forward( a8 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 > -typename boost::detail::sp_if_not_array< T >::type make_shared( BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5, BOOST_FWD_REF(A6) a6, BOOST_FWD_REF(A7) a7, BOOST_FWD_REF(A8) a8, BOOST_FWD_REF(A9) a9 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ), - boost::forward( a2 ), - boost::forward( a3 ), - boost::forward( a4 ), - boost::forward( a5 ), - boost::forward( a6 ), - boost::forward( a7 ), - boost::forward( a8 ), - boost::forward( a9 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 > -typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2, BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(A4) a4, BOOST_FWD_REF(A5) a5, BOOST_FWD_REF(A6) a6, BOOST_FWD_REF(A7) a7, BOOST_FWD_REF(A8) a8, BOOST_FWD_REF(A9) a9 ) -{ - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); - - boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); - - void * pv = pd->address(); - - ::new( pv ) T( - boost::forward( a1 ), - boost::forward( a2 ), - boost::forward( a3 ), - boost::forward( a4 ), - boost::forward( a5 ), - boost::forward( a6 ), - boost::forward( a7 ), - boost::forward( a8 ), - boost::forward( a9 ) - ); - - pd->set_initialized(); - - T * pt2 = static_cast< T* >( pv ); - - boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); -} - -#endif // !defined( BOOST_NO_CXX11_VARIADIC_TEMPLATES ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - #undef BOOST_SP_MSD } // namespace boost diff --git a/include/boost/smart_ptr/make_unique.hpp b/include/boost/smart_ptr/make_unique.hpp index 1834007..0c032ef 100644 --- a/include/boost/smart_ptr/make_unique.hpp +++ b/include/boost/smart_ptr/make_unique.hpp @@ -25,14 +25,12 @@ make_unique() return std::unique_ptr(new T()); } -#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) template inline typename enable_if_::value, std::unique_ptr >::type make_unique(Args&&... args) { return std::unique_ptr(new T(std::forward(args)...)); } -#endif template inline typename enable_if_::value, std::unique_ptr >::type diff --git a/test/allocate_local_shared_array_construct_test.cpp b/test/allocate_local_shared_array_construct_test.cpp index 0f8bc1b..6989f6a 100644 --- a/test/allocate_local_shared_array_construct_test.cpp +++ b/test/allocate_local_shared_array_construct_test.cpp @@ -5,12 +5,9 @@ Copyright 2017 Glen Joseph Fernandes Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ -#include -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \ - !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \ - !defined(BOOST_NO_CXX11_ALLOCATOR) -#include #include +#include +#include struct allow { }; @@ -157,9 +154,3 @@ int main() } return boost::report_errors(); } -#else -int main() -{ - return 0; -} -#endif diff --git a/test/allocate_local_shared_array_esft_test.cpp b/test/allocate_local_shared_array_esft_test.cpp index 7138745..7ce0674 100644 --- a/test/allocate_local_shared_array_esft_test.cpp +++ b/test/allocate_local_shared_array_esft_test.cpp @@ -5,12 +5,10 @@ Copyright 2017 Glen Joseph Fernandes Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ -#include -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \ - !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) -#include -#include #include +#include +#include +#include template struct creator { @@ -95,9 +93,3 @@ int main() } return boost::report_errors(); } -#else -int main() -{ - return 0; -} -#endif diff --git a/test/allocate_local_shared_array_noinit_test.cpp b/test/allocate_local_shared_array_noinit_test.cpp index e2e1619..f4a5593 100644 --- a/test/allocate_local_shared_array_noinit_test.cpp +++ b/test/allocate_local_shared_array_noinit_test.cpp @@ -5,14 +5,12 @@ Copyright 2017 Glen Joseph Fernandes Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ -#include -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \ - !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) -#include -#include #include #include +#include #include +#include +#include template struct creator { @@ -246,9 +244,3 @@ int main() } return boost::report_errors(); } -#else -int main() -{ - return 0; -} -#endif diff --git a/test/allocate_local_shared_array_test.cpp b/test/allocate_local_shared_array_test.cpp index 34f3d42..d1a5447 100644 --- a/test/allocate_local_shared_array_test.cpp +++ b/test/allocate_local_shared_array_test.cpp @@ -5,14 +5,12 @@ Copyright 2017 Glen Joseph Fernandes Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ -#include -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \ - !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) -#include -#include #include #include +#include #include +#include +#include template struct creator { @@ -267,9 +265,3 @@ int main() } return boost::report_errors(); } -#else -int main() -{ - return 0; -} -#endif diff --git a/test/allocate_local_shared_array_throws_test.cpp b/test/allocate_local_shared_array_throws_test.cpp index 78ae6b6..7738bfa 100644 --- a/test/allocate_local_shared_array_throws_test.cpp +++ b/test/allocate_local_shared_array_throws_test.cpp @@ -5,11 +5,9 @@ Copyright 2017 Glen Joseph Fernandes Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ -#include -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \ - !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) -#include #include +#include +#include template struct creator { @@ -122,9 +120,3 @@ int main() } return boost::report_errors(); } -#else -int main() -{ - return 0; -} -#endif diff --git a/test/allocate_local_shared_array_value_test.cpp b/test/allocate_local_shared_array_value_test.cpp index 7d9c35f..51d2637 100644 --- a/test/allocate_local_shared_array_value_test.cpp +++ b/test/allocate_local_shared_array_value_test.cpp @@ -5,11 +5,9 @@ Copyright 2017 Glen Joseph Fernandes Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ -#include -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \ - !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) -#include #include +#include +#include template struct creator { @@ -84,9 +82,3 @@ int main() } return boost::report_errors(); } -#else -int main() -{ - return 0; -} -#endif diff --git a/test/allocate_local_shared_arrays_test.cpp b/test/allocate_local_shared_arrays_test.cpp index d45a686..64391c3 100644 --- a/test/allocate_local_shared_arrays_test.cpp +++ b/test/allocate_local_shared_arrays_test.cpp @@ -5,12 +5,9 @@ Copyright 2017 Glen Joseph Fernandes Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ -#include -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \ - !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \ - !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) -#include #include +#include +#include template struct creator { @@ -85,9 +82,3 @@ int main() } return boost::report_errors(); } -#else -int main() -{ - return 0; -} -#endif diff --git a/test/allocate_local_shared_esft_test.cpp b/test/allocate_local_shared_esft_test.cpp index 65349c5..1a08e79 100644 --- a/test/allocate_local_shared_esft_test.cpp +++ b/test/allocate_local_shared_esft_test.cpp @@ -6,20 +6,11 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt -#include - -#if defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) || defined( BOOST_NO_CXX11_VARIADIC_TEMPLATES ) - -int main() -{ -} - -#else - -#include #include #include #include +#include +#include #include class X: public boost::enable_shared_from_this @@ -294,5 +285,3 @@ int main() return boost::report_errors(); } - -#endif diff --git a/test/allocate_local_shared_test.cpp b/test/allocate_local_shared_test.cpp index fa53dc0..df99aaa 100644 --- a/test/allocate_local_shared_test.cpp +++ b/test/allocate_local_shared_test.cpp @@ -6,20 +6,11 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt -#include - -#if defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) || defined( BOOST_NO_CXX11_VARIADIC_TEMPLATES ) - -int main() -{ -} - -#else - -#include #include #include #include +#include +#include #include class X @@ -231,5 +222,3 @@ int main() return boost::report_errors(); } - -#endif diff --git a/test/get_local_deleter_array_test2.cpp b/test/get_local_deleter_array_test2.cpp index 999fffe..2cf38b6 100644 --- a/test/get_local_deleter_array_test2.cpp +++ b/test/get_local_deleter_array_test2.cpp @@ -8,19 +8,10 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#include - -#if defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) || defined( BOOST_NO_CXX11_VARIADIC_TEMPLATES ) - -int main() -{ -} - -#else - #include #include #include +#include struct deleter { @@ -70,5 +61,3 @@ int main() struct deleter2 { }; - -#endif diff --git a/test/get_local_deleter_test3.cpp b/test/get_local_deleter_test3.cpp index 655c7fc..570c5c8 100644 --- a/test/get_local_deleter_test3.cpp +++ b/test/get_local_deleter_test3.cpp @@ -8,19 +8,10 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#include - -#if defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) || defined( BOOST_NO_CXX11_VARIADIC_TEMPLATES ) - -int main() -{ -} - -#else - #include #include #include +#include struct deleter { @@ -55,5 +46,3 @@ int main() struct deleter2 { }; - -#endif diff --git a/test/make_local_shared_array_esft_test.cpp b/test/make_local_shared_array_esft_test.cpp index 5106f39..1587c07 100644 --- a/test/make_local_shared_array_esft_test.cpp +++ b/test/make_local_shared_array_esft_test.cpp @@ -5,12 +5,10 @@ Copyright 2017 Glen Joseph Fernandes Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ -#include -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \ - !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) -#include -#include #include +#include +#include +#include class type : public boost::enable_shared_from_this { @@ -58,9 +56,3 @@ int main() } return boost::report_errors(); } -#else -int main() -{ - return 0; -} -#endif diff --git a/test/make_local_shared_array_noinit_test.cpp b/test/make_local_shared_array_noinit_test.cpp index f4a07a2..aa96bdc 100644 --- a/test/make_local_shared_array_noinit_test.cpp +++ b/test/make_local_shared_array_noinit_test.cpp @@ -5,14 +5,12 @@ Copyright 2017 Glen Joseph Fernandes Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ -#include -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \ - !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) -#include -#include #include #include +#include #include +#include +#include class type { public: @@ -208,9 +206,3 @@ int main() } return boost::report_errors(); } -#else -int main() -{ - return 0; -} -#endif diff --git a/test/make_local_shared_array_test.cpp b/test/make_local_shared_array_test.cpp index 2781763..49636bb 100644 --- a/test/make_local_shared_array_test.cpp +++ b/test/make_local_shared_array_test.cpp @@ -5,14 +5,12 @@ Copyright 2017 Glen Joseph Fernandes Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ -#include -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \ - !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) -#include -#include #include #include +#include #include +#include +#include class type { public: @@ -230,9 +228,3 @@ int main() } return boost::report_errors(); } -#else -int main() -{ - return 0; -} -#endif diff --git a/test/make_local_shared_array_throws_test.cpp b/test/make_local_shared_array_throws_test.cpp index 3956063..2eb07e2 100644 --- a/test/make_local_shared_array_throws_test.cpp +++ b/test/make_local_shared_array_throws_test.cpp @@ -5,11 +5,9 @@ Copyright 2017 Glen Joseph Fernandes Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ -#include -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \ - !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) -#include #include +#include +#include class type { public: @@ -85,9 +83,3 @@ int main() } return boost::report_errors(); } -#else -int main() -{ - return 0; -} -#endif diff --git a/test/make_local_shared_array_value_test.cpp b/test/make_local_shared_array_value_test.cpp index 08b436c..3aa6b45 100644 --- a/test/make_local_shared_array_value_test.cpp +++ b/test/make_local_shared_array_value_test.cpp @@ -5,11 +5,9 @@ Copyright 2017 Glen Joseph Fernandes Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ -#include -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \ - !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) -#include #include +#include +#include int main() { @@ -47,9 +45,3 @@ int main() } return boost::report_errors(); } -#else -int main() -{ - return 0; -} -#endif diff --git a/test/make_local_shared_arrays_test.cpp b/test/make_local_shared_arrays_test.cpp index 986b88f..e75bdce 100644 --- a/test/make_local_shared_arrays_test.cpp +++ b/test/make_local_shared_arrays_test.cpp @@ -5,12 +5,9 @@ Copyright 2017 Glen Joseph Fernandes Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ -#include -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \ - !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \ - !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) -#include #include +#include +#include int main() { @@ -48,9 +45,3 @@ int main() } return boost::report_errors(); } -#else -int main() -{ - return 0; -} -#endif diff --git a/test/make_local_shared_const_test.cpp b/test/make_local_shared_const_test.cpp index a57577e..98eb469 100644 --- a/test/make_local_shared_const_test.cpp +++ b/test/make_local_shared_const_test.cpp @@ -6,20 +6,11 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt -#include - -#if defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) || defined( BOOST_NO_CXX11_VARIADIC_TEMPLATES ) - -int main() -{ -} - -#else - -#include #include #include #include +#include +#include #include class X @@ -258,5 +249,3 @@ int main() return boost::report_errors(); } - -#endif diff --git a/test/make_local_shared_esft_test.cpp b/test/make_local_shared_esft_test.cpp index b5e130e..525cc3e 100644 --- a/test/make_local_shared_esft_test.cpp +++ b/test/make_local_shared_esft_test.cpp @@ -6,20 +6,11 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt -#include - -#if defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) || defined( BOOST_NO_CXX11_VARIADIC_TEMPLATES ) - -int main() -{ -} - -#else - -#include #include #include #include +#include +#include class X: public boost::enable_shared_from_this { @@ -304,5 +295,3 @@ int main() return boost::report_errors(); } - -#endif diff --git a/test/make_local_shared_test.cpp b/test/make_local_shared_test.cpp index e972c0d..c9b7167 100644 --- a/test/make_local_shared_test.cpp +++ b/test/make_local_shared_test.cpp @@ -6,20 +6,11 @@ // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt -#include - -#if defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) || defined( BOOST_NO_CXX11_VARIADIC_TEMPLATES ) - -int main() -{ -} - -#else - -#include #include #include #include +#include +#include #include class X @@ -264,5 +255,3 @@ int main() return boost::report_errors(); } - -#endif diff --git a/test/make_unique_args_test.cpp b/test/make_unique_args_test.cpp index 66c963d..96671e8 100644 --- a/test/make_unique_args_test.cpp +++ b/test/make_unique_args_test.cpp @@ -55,7 +55,6 @@ int main() BOOST_TEST(type::instances == 0); } -#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) { std::unique_ptr result = boost::make_unique(1); BOOST_TEST(result.get() != 0); @@ -143,6 +142,6 @@ int main() result.reset(); BOOST_TEST(type::instances == 0); } -#endif + return boost::report_errors(); }