Код: Выделить всё
#include
#include
struct A : public std::enable_shared_from_this
{
~A()
{
auto this_ptr = shared_from_this(); // std::bad_weak_ptr exception here.
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/28338978/stdenable-shared-from-this-is-it-allowed-to-call-shared-from-this-in-destru[/url]