R
rami
I have some code which does following thing
template<class X, unsigned ID = 0>
struct SomeStruct
{
template<class X>
static SomeStruct<X, ID + 1>& SomeFunc();
...
...
...
...
};
It has more than one overloads of SomeFunc and some other function
which have same return types.
Well i can understand the code pretty much but what i need to
understand is why ID is being used and increamented everytime on the
return?
I think its to avoid the compiler to use the same instiation - but i go
blank when i try to expand on my thought :-|
Any help would be appreciated, in case the example is vague i can maybe
post more..
Regards,
Rami
template<class X, unsigned ID = 0>
struct SomeStruct
{
template<class X>
static SomeStruct<X, ID + 1>& SomeFunc();
...
...
...
...
};
It has more than one overloads of SomeFunc and some other function
which have same return types.
Well i can understand the code pretty much but what i need to
understand is why ID is being used and increamented everytime on the
return?
I think its to avoid the compiler to use the same instiation - but i go
blank when i try to expand on my thought :-|
Any help would be appreciated, in case the example is vague i can maybe
post more..
Regards,
Rami