Created
April 12, 2013 15:46
-
-
Save ALSchwalm/5372999 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
num test_enum | |
{ | |
A, | |
B, | |
C | |
}; | |
template<test_enum T> | |
int f(int x); | |
template<test_enum T> | |
int f(int x, int y); | |
template<> | |
int f<C>(int x) | |
{ | |
return x+2; | |
}; | |
template<> | |
int f<B>(int x, int y) | |
{ | |
return x+y; | |
}; | |
int main() | |
{ | |
int temp = f<B>(1, 2); //temp=3 | |
return f<C>(1); //returns 3 | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment