Skip to content

Instantly share code, notes, and snippets.

@taeguk
Last active December 20, 2015 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taeguk/1f8c648ee76e72413cc7 to your computer and use it in GitHub Desktop.
Save taeguk/1f8c648ee76e72413cc7 to your computer and use it in GitHub Desktop.
aa.cpp
class A {
private:
A() {};
public:
static A factory_A() { reutrn A(); }
}
// friend declaration for std::make_shared
// works on VS2010
friend std::tr1::_Ref_count_obj<T>
// works on VS2015
friend std::_Ref_count_obj<PngImage>;
class A {
private:
A() {};
class PrivateKey() {};
public:
A(PrivateKey) : A() {}
static std::shared_ptr<A> factory_A() { reutrn make_shared<A>(PrivateKey()); }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment