Created
August 11, 2015 15:50
-
-
Save andrey-malets/40a6406baf2bf7d8a93b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| template<typename> struct T { | |
| }; | |
| template<> struct T<int> { | |
| static const int value = 1; | |
| }; | |
| template<> struct T<float> { | |
| static const int value = 2; | |
| }; | |
| template<template<typename> class T> int f() { | |
| return T<int>::value; | |
| } | |
| template<> int f<T>() { | |
| return T<float>::value; | |
| } | |
| int main(void) { | |
| return f<T>(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment