Interesting that I have got some down votes for this. I like free too, but just remember that everything has a cost. None of this stuff is actually free. Someone somewhere is paying for it.
The point is that there is an actual cost, so don’t complain that there are things you have to pay for. You wouldn’t work for free, so don’t expect others to. There is a general expectation that everything will be supplied for free, but that is clearly unsustainable. Perhaps by putting part of the information behind a paywall there is less mining of your data (which is where you are then product comes in to play). Sadly I doubt it, but at least it’s a possibility.
because unique_ptr<T[N]> you can declare, but can't defined and initialize ). unique_ptr<T[]> exists, but it didn't know our size, shared_ptr<T[]> also not hardened.
43
u/johannes1971 Sep 11 '26
Don't you just love how they put the discussion of performance cost behind a paywall...
34
u/James20k P2005R0 Sep 12 '26
I'm not sure how I feel about articles partially locked behind a paywall around here
10
u/Fabulous-Meaning-966 Sep 11 '26
I'm surprised they didn't mention `std::optional` dereference with `operator*` / `operator->`.
1
u/anotherprogrammer25 Sep 14 '26
Interesting, that hardening is supported for shared_ptr<T[N]>, but not for unique_ptr<T[N]>.