Created
August 8, 2017 19:45
-
-
Save melvyniandrag/339966a0e64f6198b4edf0a84f2879f9 to your computer and use it in GitHub Desktop.
Template functions in source
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
#include "t.h" | |
int main() | |
{ | |
myClass mc; | |
mc.f(1); | |
mc.f("hi"); | |
} |
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
#include <iostream> | |
#include "t.h" | |
template<class T> | |
void myClass::f<T>(T t) | |
{ | |
std::cout << t << std::endl; | |
} |
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
class myClass | |
{ | |
public: | |
template<class T> | |
void f(T t); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment