I have this class:
template <typename T, uint64_t N>
struct Probe {
static const uint64_t Counter = N;
typedef T Type;
};
Which I utilize as:
typedef Probe <int, 0> FirstIntProbe;
typedef Probe <int, 1> SecondIntProbe;
typedef Probe <float, 2> FloatProbe;
Is it possible to create a compile time\macro method which allows me to instantiate this class without specifying the second parameter such as:
typedef Probe <int, Something?> FirstIntProbe;
typedef Probe <int, Something?> SecondIntProbe;
typedef Probe <float, Something?> FloatProbe;
I assume this is isn't possible, but then again I've seen people do things in C++ I wouldn't think was possible before.
Update:
- It is not necessary to increase by one, it's just important that every probe have it's own number.
- It is not needed to have unique number across different .cpp files\translation units.