Skip to content

Instantly share code, notes, and snippets.

@thiagomg thiagomg/temp_gen.cpp
Last active Aug 29, 2015

What would you like to do?
Templates e geração de código
class NonTemplated {
int value;
using value_type = int;
NonTemplated(int a) : value(a) {}
int sum(int a) { return value + a; }
template <typename T>
class Templated {
T value;
using value_type = T;
Templated(T a) : value(a) {}
T sum(T a) { return value + a; }
NonTemplated nt{1};
Templated<int> ti{1};
Templated<double> td{1.0};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.