The semantics of `std::reference_wrapper`

It tells people who read the code that "whoever" has the variable, isn't actually controlling its lifespan. The user hasn't forgotten to delete or new anything, which some people may start to look for when they see pointer semantics. via @philluminati…

Obtaining a std::shared_ptr from this pointer

std::enable_shared_from_this enables you to get a valid std::shared_ptr instance to this, when all you have is this. Without it, you would have no way of getting a std::shared_ptr to this, unless you had already one as a member. class Y: public std:…

Algorithms and value semantics

A nice consideration on value semantics and STL/boost algorithms: In generic implementations of algorithms it is preferred to use value semantics: copying an object causes two identical objects to exist which are independent. This is crucial property when it is necessary to duplicate objects. Dynamic polymorphism doesn't immediately work…