Skip to content

Commit

Permalink
Template arguments in overload?
Browse files Browse the repository at this point in the history
  • Loading branch information
XeCycle committed Sep 23, 2016
1 parent 6f2f52f commit 5c3f9d7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions template-arg-overload.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
template <int N>
int f()
{
return 42;
}

template <unsigned N>
int f()
{
return -42;
}

int g(int)
{
return 42;
}

int g(unsigned)
{
return -42;
}

int main(int argc, char** argv)
{
return g(1) + g(1u) + f<1>() + f<1u>();
}

0 comments on commit 5c3f9d7

Please sign in to comment.