friend functions and namespaces?
Why is it that if I do:
I'm scolded with errors saying that n is protected, but if I remove the namespace declaration, everything works fine? What's the correct way to do this? I'm about to abandon namespaces entirely if they're such a chore.
namespace myspace {
class Test {
protected:
int n;
friend void testit(Test);
};
}
void testit(myspace::Test t)
{
t.n = 5;
}
I'm scolded with errors saying that n is protected, but if I remove the namespace declaration, everything works fine? What's the correct way to do this? I'm about to abandon namespaces entirely if they're such a chore.
