Skip to content

Instantly share code, notes, and snippets.

@habfast
Created November 22, 2017 07:21
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 habfast/73cb0e2b288fdb35c43248b45caa3bc0 to your computer and use it in GitHub Desktop.
Save habfast/73cb0e2b288fdb35c43248b45caa3bc0 to your computer and use it in GitHub Desktop.
#include <cstdio>
template<int n> struct confusing
{
static int q;
};
template<> struct confusing<1>
{
template<int n>
struct q
{
q(int x)
{
printf("Separated syntax and semantics.\n");
}
operator int () { return 0; }
};
};
char x;
int main()
{
int x = confusing<sizeof(x)>::q < 3 > (2);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment