Skip to content

Instantly share code, notes, and snippets.

@htfy96
Created March 12, 2017 10:56
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 htfy96/271e108955735ab14a3d2245af2cb3fb to your computer and use it in GitHub Desktop.
Save htfy96/271e108955735ab14a3d2245af2cb3fb to your computer and use it in GitHub Desktop.
tag example
struct Class1
{
using Tag = Tag1;
};
struct Class1B
{
using Tag = Tag1;
};
struct Class2
{
using Tag = Tag2;
};
template<typename T>
void f(T obj)
{
f_impl(T::Tag, obj);
}
template<typename T>
void f_impl(Tag1, T obj)
{
}
template<typename T>
void f_impl(Tag2, T obj)
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment