Skip to content

Instantly share code, notes, and snippets.

@melvyniandrag
Created August 8, 2017 19:45
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 melvyniandrag/339966a0e64f6198b4edf0a84f2879f9 to your computer and use it in GitHub Desktop.
Save melvyniandrag/339966a0e64f6198b4edf0a84f2879f9 to your computer and use it in GitHub Desktop.
Template functions in source
#include "t.h"
int main()
{
myClass mc;
mc.f(1);
mc.f("hi");
}
#include <iostream>
#include "t.h"
template<class T>
void myClass::f<T>(T t)
{
std::cout << t << std::endl;
}
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