Boost logo

Boost :

From: Alexander Grund (alexander.grund_at_[hidden])
Date: 2023-01-10 14:59:44


> See `std::map::try_emplace(k, args…)`.
>
> https://en.cppreference.com/w/cpp/container/map/try_emplace
>
> Notes:
> Unlike insert or emplace, these functions do not move from rvalue arguments if the insertion does not happen.

Yes, however at the callsite you can clearly see the different
semantics: "try_"
That's much harder for a constructor. Although a well-named factory
method might be a solution if this semantic is useful.




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