← Back to context

Comment by smallstepforman

4 days 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?

So data structures like std::vector should never be copied - period?

  • I 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.