Boost logo

Boost :

Subject: [boost] [smart_ptr] extra colon on make_shared variadic template instantiation
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2013-09-17 13:45:45


Hi,

while instantiating this template, the Intel compiler finds that there
is an extra colon when Args is empty.

     ::new( pv ) T( boost::detail::sp_forward<Arg1>( arg1 ),
boost::detail::sp_forward<Args>( args )... );
^
Is this a bug on the compiler or on Boost.SmartPtr?

Best,
Vicente

template< class T, class Arg1, class... Args > typename
boost::detail::sp_if_not_array< T >::type make_shared( Arg1 && arg1,
Args && ... args )
{
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );

     boost::detail::sp_ms_deleter< T > * pd =
static_cast<boost::detail::sp_ms_deleter< T > *>(
pt._internal_get_untyped_deleter() );

     void * pv = pd->address();

     ::new( pv ) T( boost::detail::sp_forward<Arg1>( arg1 ),
boost::detail::sp_forward<Args>( args )... );

     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 );
}


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk