Boost logo

Boost :

From: Daniela Engert (dani_at_[hidden])
Date: 2024-04-01 05:36:30


Am 31.03.2024 um 21:17 schrieb Vinnie Falco via Boost:
> On Sun, Mar 31, 2024 at 11:04 AM Ivan Matek via Boost<boost_at_[hidden]>
> wrote:
>
>> My guess would be that >80% of users of boost SmartPtr are just annoyed
>> that 13 y after C++11 they have mix of Boost and std in their codebase.
>> Because in real codebases often people do not bother to upgrade old code,
>> they just start using new stuff so you end up with mix of boost and std.
>>
Right, this mixture causes avoidable costs on various metrics.

> That is probably true, but removing Boost.SmartPtr does nothing to solve
> it. If the maintainers of a code base are bothered by a mixture of smart
> pointer types, they must refactor the code base in question to use only one
> type instead. boost::shared_ptr and std::shared_ptr are almost identical,
> so an automated search and replace would likely suffice.

And possibly fall into a trap related to operators: *only* the
(in)equality operators have the same behaviour as their std::
counterpart, the other relational operators are either missing in
boost::shared_ptr (by design!) but exist for std::shared_ptr, and have
different behaviour. While both boost:: and std:: flavoured shared_ptrs
are designed to be used as keys in associative containers, they order
differently and have a different definition of equivalence. Other Boost
libraries (like e.g. Signals2) depend on that. AFAIK, this isn't brought
to attention anywhere (but what do I know).

Thanks,
Dani

-- 
PGP/GPG: 2CCB 3ECB 0954 5CD3 B0DB 6AA0 BA03 56A1 2C4638C5

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