Answers for "std::enable_shared_from_this include"

0

std::enable_shared_from_this include

#include <memory>
#include <iostream>
 
struct Good: std::enable_shared_from_this<Good> // note: public inheritance
{
    std::shared_ptr<Good> getptr() {
        return shared_from_this();
    }
};
 
Posted by: Guest on August-07-2021

Browse Popular Code Answers by Language