D
Dilip
I am a little confused about the difference between SFINAE and
unambiguous overload resolution set. For ex:
template<typename T> void func(T);
template<typename T> void func(T*);
now, func<int> is going to be ambiguous. Ok so far so good.
Now:
template<int N> int g() { }
template<int* P> int g() { }
g<1>();
why does SFINAE apply in this case? The literal 1 is not convertible
to int* anyway, right?
I mean, shouldn't normal overload resolution rules automatically apply
in this case?
I am certain I am not understanding the correct purpose of invoking
SFINAE.
unambiguous overload resolution set. For ex:
template<typename T> void func(T);
template<typename T> void func(T*);
now, func<int> is going to be ambiguous. Ok so far so good.
Now:
template<int N> int g() { }
template<int* P> int g() { }
g<1>();
why does SFINAE apply in this case? The literal 1 is not convertible
to int* anyway, right?
I mean, shouldn't normal overload resolution rules automatically apply
in this case?
I am certain I am not understanding the correct purpose of invoking
SFINAE.