Boost logo

Boost :

Subject: Re: [boost] question about C++11 guidelines
From: Philipp Moeller (philipp.moeller_at_[hidden])
Date: 2012-05-03 13:03:38


ivan.lelann_at_[hidden] writes:

> ----- Mail original -----
>> De: "Eric Niebler" <eric_at_[hidden]>
>> ?: "Boost mailing list" <boost_at_[hidden]>
>> Envoy?: Jeudi 3 Mai 2012 00:01:52
>> Objet: [boost] question about C++11 guidelines
>>
>> Say I'm rewriting an existing Boost library and targeting C++11
>> users. I
>> plan to ship C++03 and C++11 versions of my library side-by-side, so
>> back-compat isn't an issue for the new code. Is there a reason to
>> prefer
>> using Boost's versions of utilities like enable_if, type traits,
>> integral constant wrappers (e.g. mpl::int_), tuples, etc., over the
>> now-standard ones?
>>
>> I'm leaning toward using std:: where I can, and falling back on
>> Boost's
>> versions only when there is a compelling reason.
>>
>
> What about this ?
>
> 1) If Foo is a Boost library, it should use boost::shared_ptr.
> 2) boost::shared_ptr may be an alias/using/... to std::shared_ptr. But this is up to Boost.SmartPtr, not to Boost.Foo.
>

My experience with opaque aliasing of std and boost components is rather
bad. There are some subtle differences (e.g. reference_wrapper as a
functor, mem_fn and proxies, tuple operator<<, hash), naming
incompatibilities, and you always need to test both configurations. It
isn't worth the trouble in my experience.


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