7 ms·
Oh god, what monstrocity have we created?!? All this complexity follows unique_ptr and copy constructor madness. Anything with pointers with ownership should
by smallstepforman 2mo ago
Oh god, what monstrocity have we created?!?
All this complexity follows unique_ptr and copy constructor madness.
Anything with pointers with ownership should never be copied - period. Reference pointers - OK if scope/lifetime is known.
Can we have c++11 lite?
- pjmlp 2mo agoYes, configure clang-tidy as such.
- Maxatar 2mo agoSo data structures like std::vector should never be copied - period?
- HarHarVeryFunny 2mo agoI think the parent is just referring to pointer types, not anything (like std::vector) that may use pointers internally. This "std::indirect" tries to have value semantics, but in fact it's just another type of smart pointer and uses pointer syntax (pimpl->foo : forced since C++ allows "->" as a user defined operator name, but not "."). But it's a weird sort of "pointer" given this copying behavior, which is maybe why they didn't give it a "_ptr" name.