I have such a problem:
when I write:
template<bool b> void foo(void);
template<bool b> class B
{
friend void foo<b>(void);
};
template<bool b>
void foo(void){};
everything works just fine.
But when I incapsulate all this in another class, I receive errors:
struct C
{
template<bool b> void foo(void);
template<bool b> class B
{
friend void C::foo<b>(void);
};
};
template<bool b>
void C::foo(void){};
.
In Visual C++ 2008 I get these errors:
error C2975: 'b' : invalid template argument for 'C::foo', expected compile-time constant expression;
error C2245: non-existent member function 'C::foo' specified as friend (member function signature does not match any overload).
What do I do wrong?