Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70433 - in branches/release: . boost boost/algorithm/string boost/archive boost/bimap boost/detail boost/functional/hash boost/fusion boost/fusion/container/list/detail boost/gil boost/graph boost/integer boost/interprocess boost/intrusive boost/io boost/iostreams boost/iterator boost/msm boost/numeric/ublas boost/pool boost/program_options boost/program_options/detail boost/property_tree boost/python boost/range boost/serialization boost/signals boost/smart_ptr boost/spirit boost/spirit/home boost/spirit/home/karma boost/spirit/home/support boost/statechart boost/system boost/type_traits boost/typeof boost/utility boost/uuid boost/variant boost/wave doc libs libs/algorithm/string libs/array libs/array/doc libs/array/test libs/bimap libs/date_time libs/functional/hash libs/fusion libs/graph_parallel libs/integer libs/interprocess libs/intrusive libs/io libs/io/doc libs/mpi/build libs/mpl/doc/refmanual libs/mpl/doc/src/refmanual libs/msm libs/numeric/ublas libs/numeric/ublas/doc libs/parameter/doc/html libs/pool libs/program_options libs/program_options/test libs/property_tree libs/python libs/range libs/serialization libs/serialization/doc libs/serialization/example libs/serialization/src libs/serialization/test libs/serialization/vc7ide libs/signals libs/signals2 libs/smart_ptr/test libs/spirit libs/spirit/classic/example libs/spirit/doc libs/spirit/example libs/spirit/phoenix libs/spirit/test libs/spirit/test/qi libs/statechart libs/static_assert libs/system libs/timer libs/type_traits libs/type_traits/doc libs/typeof/doc libs/units/test libs/unordered libs/utility libs/utility/swap/test libs/uuid libs/wave status tools tools/bcp tools/boostbook tools/build/v2 tools/inspect tools/quickbook tools/quickbook/doc tools/quickbook/src tools/quickbook/test tools/regression tools/regression/src tools/release tools/wave
From: pdimov_at_[hidden]
Date: 2011-03-22 19:17:51


Author: pdimov
Date: 2011-03-22 19:17:51 EDT (Tue, 22 Mar 2011)
New Revision: 70433
URL: http://svn.boost.org/trac/boost/changeset/70433

Log:
Merge [69244] to release. Fixes #4892.
Properties modified:
   branches/release/ (props changed)
   branches/release/INSTALL (props changed)
   branches/release/Jamroot (props changed)
   branches/release/LICENSE_1_0.txt (props changed)
   branches/release/boost/ (props changed)
   branches/release/boost-build.jam (props changed)
   branches/release/boost.css (props changed)
   branches/release/boost.png (props changed)
   branches/release/boost/algorithm/string/ (props changed)
   branches/release/boost/archive/ (props changed)
   branches/release/boost/archive/basic_binary_iarchive.hpp (props changed)
   branches/release/boost/array.hpp (props changed)
   branches/release/boost/bimap/ (props changed)
   branches/release/boost/concept_check.hpp (props changed)
   branches/release/boost/config.hpp (props changed)
   branches/release/boost/detail/ (props changed)
   branches/release/boost/detail/endian.hpp (props changed)
   branches/release/boost/functional/hash/ (props changed)
   branches/release/boost/fusion/ (props changed)
   branches/release/boost/fusion/container/list/detail/build_cons.hpp (props changed)
   branches/release/boost/gil/ (props changed)
   branches/release/boost/graph/ (props changed)
   branches/release/boost/integer/ (props changed)
   branches/release/boost/interprocess/ (props changed)
   branches/release/boost/intrusive/ (props changed)
   branches/release/boost/io/ (props changed)
   branches/release/boost/iostreams/ (props changed)
   branches/release/boost/iterator/iterator_facade.hpp (props changed)
   branches/release/boost/math_fwd.hpp (props changed)
   branches/release/boost/msm/ (props changed)
   branches/release/boost/numeric/ublas/ (props changed)
   branches/release/boost/numeric/ublas/functional.hpp (props changed)
   branches/release/boost/pool/ (props changed)
   branches/release/boost/program_options/ (props changed)
   branches/release/boost/program_options/detail/parsers.hpp (props changed)
   branches/release/boost/program_options/parsers.hpp (props changed)
   branches/release/boost/property_tree/ (props changed)
   branches/release/boost/python/ (props changed)
   branches/release/boost/range/ (props changed)
   branches/release/boost/serialization/ (props changed)
   branches/release/boost/signals/ (props changed)
   branches/release/boost/signals2.hpp (props changed)
   branches/release/boost/spirit/ (props changed)
   branches/release/boost/spirit/home/ (props changed)
   branches/release/boost/spirit/home/karma/ (props changed)
   branches/release/boost/spirit/home/support/attributes.hpp (props changed)
   branches/release/boost/statechart/ (props changed)
   branches/release/boost/static_assert.hpp (props changed)
   branches/release/boost/system/ (props changed)
   branches/release/boost/token_functions.hpp (props changed)
   branches/release/boost/type_traits/ (props changed)
   branches/release/boost/typeof/message.hpp (props changed)
   branches/release/boost/typeof/register_functions.hpp (props changed)
   branches/release/boost/typeof/register_functions_iterate.hpp (props changed)
   branches/release/boost/typeof/typeof.hpp (props changed)
   branches/release/boost/typeof/unsupported.hpp (props changed)
   branches/release/boost/utility/ (props changed)
   branches/release/boost/utility/value_init.hpp (props changed)
   branches/release/boost/uuid/ (props changed)
   branches/release/boost/variant/ (props changed)
   branches/release/boost/version.hpp (props changed)
   branches/release/boost/wave/ (props changed)
   branches/release/bootstrap.bat (props changed)
   branches/release/bootstrap.sh (props changed)
   branches/release/doc/ (props changed)
   branches/release/index.htm (props changed)
   branches/release/index.html (props changed)
   branches/release/libs/ (props changed)
   branches/release/libs/algorithm/string/ (props changed)
   branches/release/libs/array/ (props changed)
   branches/release/libs/array/doc/array.xml (props changed)
   branches/release/libs/array/test/Jamfile.v2 (props changed)
   branches/release/libs/array/test/array0.cpp (props changed)
   branches/release/libs/array/test/array2.cpp (props changed)
   branches/release/libs/array/test/array6.cpp (props changed)
   branches/release/libs/bimap/ (props changed)
   branches/release/libs/date_time/ (props changed)
   branches/release/libs/functional/hash/ (props changed)
   branches/release/libs/fusion/ (props changed)
   branches/release/libs/graph_parallel/ (props changed)
   branches/release/libs/integer/ (props changed)
   branches/release/libs/interprocess/ (props changed)
   branches/release/libs/intrusive/ (props changed)
   branches/release/libs/io/ (props changed)
   branches/release/libs/io/doc/ (props changed)
   branches/release/libs/libraries.htm (props changed)
   branches/release/libs/maintainers.txt (props changed)
   branches/release/libs/mpi/build/ (props changed)
   branches/release/libs/mpl/doc/refmanual/broken-compiler-workarounds.html (props changed)
   branches/release/libs/mpl/doc/refmanual/categorized-index-concepts.html (props changed)
   branches/release/libs/mpl/doc/refmanual/cfg-no-preprocessed-headers.html (props changed)
   branches/release/libs/mpl/doc/refmanual/composition-and-argument-binding.html (props changed)
   branches/release/libs/mpl/doc/refmanual/data-types-concepts.html (props changed)
   branches/release/libs/mpl/doc/refmanual/data-types-miscellaneous.html (props changed)
   branches/release/libs/mpl/doc/refmanual/extensible-associative-sequence.html (props changed)
   branches/release/libs/mpl/doc/refmanual/inserter-class.html (props changed)
   branches/release/libs/mpl/doc/refmanual/tag-dispatched-metafunction.html (props changed)
   branches/release/libs/mpl/doc/refmanual/trivial-metafunctions-summary.html (props changed)
   branches/release/libs/mpl/doc/src/refmanual/Iterators-Iterator.rst (props changed)
   branches/release/libs/msm/ (props changed)
   branches/release/libs/numeric/ublas/ (props changed)
   branches/release/libs/numeric/ublas/doc/ (props changed)
   branches/release/libs/parameter/doc/html/index.html (props changed)
   branches/release/libs/pool/ (props changed)
   branches/release/libs/program_options/ (props changed)
   branches/release/libs/program_options/test/parsers_test.cpp (props changed)
   branches/release/libs/property_tree/ (props changed)
   branches/release/libs/python/ (props changed)
   branches/release/libs/range/ (props changed)
   branches/release/libs/serialization/ (props changed)
   branches/release/libs/serialization/doc/ (props changed)
   branches/release/libs/serialization/example/ (props changed)
   branches/release/libs/serialization/src/ (props changed)
   branches/release/libs/serialization/test/test_diamond_complex.cpp (props changed)
   branches/release/libs/serialization/vc7ide/ (props changed)
   branches/release/libs/signals/ (props changed)
   branches/release/libs/signals2/ (props changed)
   branches/release/libs/spirit/ (props changed)
   branches/release/libs/spirit/classic/example/ (props changed)
   branches/release/libs/spirit/doc/ (props changed)
   branches/release/libs/spirit/example/ (props changed)
   branches/release/libs/spirit/phoenix/ (props changed)
   branches/release/libs/spirit/test/ (props changed)
   branches/release/libs/spirit/test/qi/optional.cpp (props changed)
   branches/release/libs/statechart/ (props changed)
   branches/release/libs/static_assert/ (props changed)
   branches/release/libs/system/ (props changed)
   branches/release/libs/timer/ (props changed)
   branches/release/libs/type_traits/ (props changed)
   branches/release/libs/type_traits/doc/ (props changed)
   branches/release/libs/typeof/doc/typeof.qbk (props changed)
   branches/release/libs/units/test/ (props changed)
   branches/release/libs/unordered/ (props changed)
   branches/release/libs/utility/ (props changed)
   branches/release/libs/utility/assert.html (props changed)
   branches/release/libs/utility/assert_test.cpp (props changed)
   branches/release/libs/utility/swap.html (props changed)
   branches/release/libs/utility/swap/test/std_bitset.cpp (props changed)
   branches/release/libs/utility/value_init.htm (props changed)
   branches/release/libs/utility/value_init_test.cpp (props changed)
   branches/release/libs/uuid/ (props changed)
   branches/release/libs/wave/ (props changed)
   branches/release/rst.css (props changed)
   branches/release/status/ (props changed)
   branches/release/status/Jamfile.v2 (props changed)
   branches/release/status/explicit-failures-markup.xml (props changed)
   branches/release/tools/ (props changed)
   branches/release/tools/bcp/ (props changed)
   branches/release/tools/boostbook/ (props changed)
   branches/release/tools/build/v2/ (props changed)
   branches/release/tools/inspect/ (props changed)
   branches/release/tools/quickbook/ (props changed)
   branches/release/tools/quickbook/doc/ (props changed)
   branches/release/tools/quickbook/src/ (props changed)
   branches/release/tools/quickbook/test/ (props changed)
   branches/release/tools/regression/ (props changed)
   branches/release/tools/regression/src/library_status.cpp (props changed)
   branches/release/tools/release/ (props changed)
   branches/release/tools/wave/ (props changed)
Text files modified:
   branches/release/boost/smart_ptr/make_shared.hpp | 454 ++++++++++++++++++++++++++++++++++++++++
   branches/release/libs/smart_ptr/test/make_shared_perfect_forwarding_test.cpp | 4
   2 files changed, 456 insertions(+), 2 deletions(-)

Modified: branches/release/boost/smart_ptr/make_shared.hpp
==============================================================================
--- branches/release/boost/smart_ptr/make_shared.hpp (original)
+++ branches/release/boost/smart_ptr/make_shared.hpp 2011-03-22 19:17:51 EDT (Tue, 22 Mar 2011)
@@ -173,6 +173,460 @@
     return boost::shared_ptr< T >( pt, pt2 );
 }
 
+#elif defined( BOOST_HAS_RVALUE_REFS )
+
+// For example MSVC 10.0
+
+template< class T, class A1 >
+boost::shared_ptr< T > make_shared( A1 && a1 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( 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 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( 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 >
+boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( a1 ),
+ boost::detail::sp_forward<A2>( 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 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( a1 ),
+ boost::detail::sp_forward<A2>( 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 >
+boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( a1 ),
+ boost::detail::sp_forward<A2>( a2 ),
+ boost::detail::sp_forward<A3>( 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 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( a1 ),
+ boost::detail::sp_forward<A2>( a2 ),
+ boost::detail::sp_forward<A3>( 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 >
+boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( a1 ),
+ boost::detail::sp_forward<A2>( a2 ),
+ boost::detail::sp_forward<A3>( a3 ),
+ boost::detail::sp_forward<A4>( 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 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( a1 ),
+ boost::detail::sp_forward<A2>( a2 ),
+ boost::detail::sp_forward<A3>( a3 ),
+ boost::detail::sp_forward<A4>( 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 >
+boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( a1 ),
+ boost::detail::sp_forward<A2>( a2 ),
+ boost::detail::sp_forward<A3>( a3 ),
+ boost::detail::sp_forward<A4>( a4 ),
+ boost::detail::sp_forward<A5>( 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 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( a1 ),
+ boost::detail::sp_forward<A2>( a2 ),
+ boost::detail::sp_forward<A3>( a3 ),
+ boost::detail::sp_forward<A4>( a4 ),
+ boost::detail::sp_forward<A5>( 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 >
+boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( a1 ),
+ boost::detail::sp_forward<A2>( a2 ),
+ boost::detail::sp_forward<A3>( a3 ),
+ boost::detail::sp_forward<A4>( a4 ),
+ boost::detail::sp_forward<A5>( a5 ),
+ boost::detail::sp_forward<A6>( 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 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( a1 ),
+ boost::detail::sp_forward<A2>( a2 ),
+ boost::detail::sp_forward<A3>( a3 ),
+ boost::detail::sp_forward<A4>( a4 ),
+ boost::detail::sp_forward<A5>( a5 ),
+ boost::detail::sp_forward<A6>( 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 >
+boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( a1 ),
+ boost::detail::sp_forward<A2>( a2 ),
+ boost::detail::sp_forward<A3>( a3 ),
+ boost::detail::sp_forward<A4>( a4 ),
+ boost::detail::sp_forward<A5>( a5 ),
+ boost::detail::sp_forward<A6>( a6 ),
+ boost::detail::sp_forward<A7>( 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 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( a1 ),
+ boost::detail::sp_forward<A2>( a2 ),
+ boost::detail::sp_forward<A3>( a3 ),
+ boost::detail::sp_forward<A4>( a4 ),
+ boost::detail::sp_forward<A5>( a5 ),
+ boost::detail::sp_forward<A6>( a6 ),
+ boost::detail::sp_forward<A7>( 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 >
+boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( a1 ),
+ boost::detail::sp_forward<A2>( a2 ),
+ boost::detail::sp_forward<A3>( a3 ),
+ boost::detail::sp_forward<A4>( a4 ),
+ boost::detail::sp_forward<A5>( a5 ),
+ boost::detail::sp_forward<A6>( a6 ),
+ boost::detail::sp_forward<A7>( a7 ),
+ boost::detail::sp_forward<A8>( 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 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( a1 ),
+ boost::detail::sp_forward<A2>( a2 ),
+ boost::detail::sp_forward<A3>( a3 ),
+ boost::detail::sp_forward<A4>( a4 ),
+ boost::detail::sp_forward<A5>( a5 ),
+ boost::detail::sp_forward<A6>( a6 ),
+ boost::detail::sp_forward<A7>( a7 ),
+ boost::detail::sp_forward<A8>( 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 >
+boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( a1 ),
+ boost::detail::sp_forward<A2>( a2 ),
+ boost::detail::sp_forward<A3>( a3 ),
+ boost::detail::sp_forward<A4>( a4 ),
+ boost::detail::sp_forward<A5>( a5 ),
+ boost::detail::sp_forward<A6>( a6 ),
+ boost::detail::sp_forward<A7>( a7 ),
+ boost::detail::sp_forward<A8>( a8 ),
+ boost::detail::sp_forward<A9>( 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 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+
+ boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T(
+ boost::detail::sp_forward<A1>( a1 ),
+ boost::detail::sp_forward<A2>( a2 ),
+ boost::detail::sp_forward<A3>( a3 ),
+ boost::detail::sp_forward<A4>( a4 ),
+ boost::detail::sp_forward<A5>( a5 ),
+ boost::detail::sp_forward<A6>( a6 ),
+ boost::detail::sp_forward<A7>( a7 ),
+ boost::detail::sp_forward<A8>( a8 ),
+ boost::detail::sp_forward<A9>( 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 );
+}
+
 #else
 
 // C++03 version

Modified: branches/release/libs/smart_ptr/test/make_shared_perfect_forwarding_test.cpp
==============================================================================
--- branches/release/libs/smart_ptr/test/make_shared_perfect_forwarding_test.cpp (original)
+++ branches/release/libs/smart_ptr/test/make_shared_perfect_forwarding_test.cpp 2011-03-22 19:17:51 EDT (Tue, 22 Mar 2011)
@@ -12,14 +12,14 @@
 #include <boost/make_shared.hpp>
 #include <boost/shared_ptr.hpp>
 
-#if !defined( BOOST_HAS_RVALUE_REFS ) || !defined( BOOST_HAS_VARIADIC_TMPL )
+#if !defined( BOOST_HAS_RVALUE_REFS )
 
 int main()
 {
     return 0;
 }
 
-#else // BOOST_HAS_RVALUE_REFS, BOOST_HAS_VARIADIC_TMPL
+#else // BOOST_HAS_RVALUE_REFS
 
 class myarg
 {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk