W
wkaras
I tried a couple of compilers, and both gave errors compiling this:
template <bool fin, typename T>
T foo(T val);
template <typename T>
T foo<true, T>(T val) { return(val); }
But both gave no errors compiling this:
template <bool fin, typename T>
struct foo
{
T operator () (T val);
};
template <typename T>
struct foo<true, T>
{
T operator () (T val) { return(val); }
};
Does the Standard truly have different rules for partial specialization
for function templates vs. class templates? If so, why?
template <bool fin, typename T>
T foo(T val);
template <typename T>
T foo<true, T>(T val) { return(val); }
But both gave no errors compiling this:
template <bool fin, typename T>
struct foo
{
T operator () (T val);
};
template <typename T>
struct foo<true, T>
{
T operator () (T val) { return(val); }
};
Does the Standard truly have different rules for partial specialization
for function templates vs. class templates? If so, why?