Boost logo

Boost :

Subject: Re: [boost] boost and vendor's TR1 implementations
From: Michael Marcin (mike.marcin_at_[hidden])
Date: 2008-11-11 16:03:41


Sergey Sadovnikov wrote:
> Hello, Michael.
>
> Tuesday, November 11, 2008 at 11:09:03 PM you wrote:
>
> MM> Sergey Sadovnikov wrote:
>>> Do you mean what there is no way to make boost and TR1 implementations
>>> don't conflict each other? And, for example, boost::shared_ptr
>>> couldn't be transparently replaced by corresponding TR1
>>> class?
>>>
> MM> Correct, TR1 shared_ptr doesn't support boost::make_shared for instance.
>
> Hm. How I can see, boost::make_shared doesn't demand from shared_ptr
> class something special which not covered by TR1 specification. So I
> can replace explicit implementation of boost::shared_ptr with 'using
> std::tr1::shared_ptr' directive. Am I right?
>
>

I'm pretty sure make_shared relies on implementation details of
boost::shared_ptr. Also I IIRC boost::shared_ptr's aliasing constructor
isn't in std::tr1::shared_ptr.

There are other reasons that you might want to use the boost versions
over the tr1 versions. For instance the boost unordered containers are
supposedly faster than the vc9sp1 tr1 implementation and the vc9sp1
tr1::function has a broken swap which prevents it from being used in the
std::containers because of the "Swaptimization".

-- 
Michael Marcin

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