Subject: Re: [boost] boost and vendor's TR1 implementations
From: John Maddock (john_at_[hidden])
Date: 2008-11-12 04:41:11


Sergey Sadovnikov wrote:
>>> Many of the boost libraries have evolved beyond their TR1 counter
>>> parts. Boost's shared_ptr is a good example of this. I primarily
>>> use VC9 SP1 which has a tr1 implementation but I use features of
>>> boost::shared_ptr that std::tr1::shared_ptr doesn't have.
>>
>> Do you mean what there is no way to make boost and TR1
>> implementations
>> don't conflict each other?

IMO they don't conflict *now*, not unless carelessly polute the global
namespace.

BTW Boost.TR1 has the semantics you were looking for:

#include <memory> // with boost/tr1/tr1 in the include path

std::tr1::shared_ptr<foo> fooptr; // uses vendor supplied shared_ptr if
available, otherwise Boost version.

>> And, for example, boost::shared_ptr
>> couldn't be transparently replaced by corresponding TR1
>> class?

The Boost versions of the TR1 components typically have extensions that
aren't available in the standard versions. Further some people may prefer
to use *the same implementation*, ie the Boost one, across multiple
platforms and compilers. IMO the Boost versions should continue to exist
and evolve.

John.