Boost logo

Boost :

From: Gavin Lambert (boost_at_[hidden])
Date: 2021-10-18 04:13:53


On 18/10/2021 16:31, Emil Dotchevski wrote:
> On Sun, Oct 17, 2021 at 7:22 PM Vinnie Falco wrote:
>> If we want Boost to stay in the game, it has to adapt its offering to
>> be more friendly and seamless with std library vocabulary types. Peter
>> has already done much of this work, making boost::error_code
>> seamlessly interoperable with std::error_code (thanks for that!).
>
> Should boost::shared_ptr be seamlessly interoperable with std::shared_ptr?
> Why (or why not)?

Ideally, yes. It's not super hard to use the deleter mechanism to make
them mostly interoperable (though not perfectly seamless, if you're
inspecting use_counts).

I'm happy to contribute such a wrapper to Peter if he's so inclined,
since I have one lying around (though wouldn't be surprised if he
already had his own).

Having said that, it's not without caveats (which I'm willing to live
with but others might be less so), and there is some functionality that
boost::shared_ptr has that std::shared_ptr lacks, which can be useful at
times (notably enable_shared_from_raw and local_shared_ptr).

So for those reasons it might be preferable to have it be an opt-in (or
even customizable) behaviour rather than by default, because they're
*not* drop-in replacements for each other, unlike things like
std::error_code.


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