Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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();
    }
};
 
Source by en.cppreference.com #
 
PREVIOUS NEXT
Tagged: #include
ADD COMMENT
Topic
Name
9+2 =