M
MiG
Hello,
Consider the following code snippet:
class B
{
protected:
B() {}
~B() {}
};
class A
{
friend B:B();
public:
A() {}
~A() {}
};
Compiling this code produces the following error:
Why can I not give B's constructor privileged access to A?
Consider the following code snippet:
class B
{
protected:
B() {}
~B() {}
};
class A
{
friend B:B();
public:
A() {}
~A() {}
};
Compiling this code produces the following error:
error C2248: 'B::B' : cannot access protected member declared in class 'B'
Why can I not give B's constructor privileged access to A?