
Daniel Frey wrote:
On Sun, 2008-07-27 at 18:25 +0300, Peter Dimov wrote:
You should be able to make it work by making the appropriate make_shared overload a friend:
template< class T, class A1, class A2 > friend boost::shared_ptr< T > boost::make_shared( A1 const & a1, A2 const & a2 );
Good idea, thanks. It would also render create() useless, since the user could call make_shared directly. Sadly, it doesn't work for me. I've tried it with GCC 4.3: [...] Is this a bug in GCC's implementation of make_shared and I should file a bug report for it? Is it intended to standardize that the above code should work?
It's not a bug. The draft standard says nothing about where the instance will be created. I would expect most implementations to do it in some private auxiliary function. -- Daniel Wallin BoostPro Computing http://www.boostpro.com