Boost logo

Boost :

Subject: Re: [boost] Curiousity question
From: Edward Diener (eldiener_at_[hidden])
Date: 2016-10-12 21:19:22


On 10/12/2016 8:40 PM, Stefan Seefeld wrote:
> On 12.10.2016 20:20, Edward Diener wrote:
>> On 10/12/2016 7:17 PM, Stefan Seefeld wrote:
>>> At this point in time (with GCC 6.2 as my default compiler in my
>>> development environment), I'd use std::shared_ptr, and fall back to
>>> boost::shared_ptr for environments without C++11 support.
>>
>> How would you fall back to support boost::shared_ptr ?
>
> With something as simple as:
>
> #if __cplusplus >= 201103L
> // use std::shared_ptr
> ...
> #else
> // use boost::shared_ptr
> ...
> #endif
>

Wouldn't you need to duplicate the above every time you are using shared
pointers ?

>>
>>>
>>> (In practice it's often the other way around. Consider Boost.Python: it
>>> has been supporting boost::shared_ptr for a long time, and I just now
>>> managed to add support for std::shared_ptr. I expect to eventually
>>> deprecate support for boost::shared_ptr, but that will still take a few
>>> years.)
>>
>> So your interface(s) need to support both in the meantime ?
>
> Yes.

OK, Thanks !


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