See More

#include "rlibns/Singleton.h" #include class Foo: rlibns::Singleton{ public: static Foo* GetInstance(){ return rlibns::Singleton::GetSingleton(); } ~Foo(){ std::cout<<"~Foo"<<:endl compiles success but foo cannot be converted to foo2 we are still safe in this case class foo2: rlibns::singleton public: getinstance return rlibns::singleton::getsingleton>(); // } // }; int main(){ std::cout<<:getinstance std::cout return>