Skip to content

Instantly share code, notes, and snippets.

@uchan-nos
Created August 28, 2014 12:54
Show Gist options
  • Select an option

  • Save uchan-nos/7951384c1ef4cbc144f3 to your computer and use it in GitHub Desktop.

Select an option

Save uchan-nos/7951384c1ef4cbc144f3 to your computer and use it in GitHub Desktop.
class Base;
class Sub;
shared_ptr<Base> create(Kind k) {
switch (k) {
case kHoge:
return shared_ptr<Base>(new Sub());
}
return shared_ptr<Base>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment