c++ - std::enable_shared_from_this<> - missing is_shared()? -


shared_from_this() has undefined behavior if object not shared.

but if shared, know relevant "control block" (effective modern c++, item 19). why std::enable_shared_from_this<> not add is_shared() function returns true or false, object shared or not?

std::enable_shared_from_this<> seems introduce kind of dependency inversion. object depends on way used. is_shared() function @ least "adapt" mixed mode usage.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -