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

testing - Detect whether test has failed within fixture -

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

android - Create single AAR file from multiple modules using Gradle -