I have this code that doesn\'t work, but I think the intent is clear:
testmakeshared.cpp
#include
class A {
public:
stat
Possibly the simplest solution. Based on the previous answer by Mohit Aron and incorporating dlf's suggestion.
#include
class A
{
public:
static std::shared_ptr create()
{
struct make_shared_enabler : public A {};
return std::make_shared();
}
private:
A() {}
};