Instantly share code, notes, and snippets.

Embed
What would you like to do?
Templates e geração de código
int sumNonTemplated(int a, int b) {
return a+b;
}
template <typename T>
T sumTemplated(T a, T b) {
return a+b;
}
void run() {
sumTemplated(1, 2);
sumTemplated(1.0, 2.0);
sumTemplated(1.0f, 2.0f);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment