Skip to content

Instantly share code, notes, and snippets.

@charlesxsh
Last active February 16, 2019 09:39
Show Gist options
  • Save charlesxsh/7675d47c57c2056a4fe19af773ded7d9 to your computer and use it in GitHub Desktop.
Save charlesxsh/7675d47c57c2056a4fe19af773ded7d9 to your computer and use it in GitHub Desktop.
struct Dog {};
struct Husky: public Dog {};
struct Poodle:public Dog {};
template<class T>
void DogCanBeSmartExceptHusky(const T&& dog) {};
int main()
{
DogCanBeSmartExceptHusky( Poodle{} );
DogCanBeSmartExceptHusky( Husky{} );
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment