std::enable_shared_from_this — cppreference.com c++ - std::bad_weak_ptr exception when using shared_from_this - Stack Overflow