M
marco_segurini
Hi,
the following test program shows a solution to a problem I have had.
Now, this test program is compiled and linked by VS2003 and g++
while Comeau-on-line-compiler fails with this messages:
"ComeauTest.c", line 21: error: constant "COuter::ID" is inaccessible
int i = COuter::ID;
^
....some warning
1 error detected in the compilation of "ComeauTest.c".
who is wrong?
many thanks.
Marco.
//sample begin
namespace
{
class CInner;
}
class COuter
{
friend class CInner;
enum { ID = 5 };
};
namespace
{
class CInner
{
public:
CInner()
{
int i = COuter::ID;
}
};
} //!namespace
int main()
{
return 0;
}
the following test program shows a solution to a problem I have had.
Now, this test program is compiled and linked by VS2003 and g++
while Comeau-on-line-compiler fails with this messages:
"ComeauTest.c", line 21: error: constant "COuter::ID" is inaccessible
int i = COuter::ID;
^
....some warning
1 error detected in the compilation of "ComeauTest.c".
who is wrong?
many thanks.
Marco.
//sample begin
namespace
{
class CInner;
}
class COuter
{
friend class CInner;
enum { ID = 5 };
};
namespace
{
class CInner
{
public:
CInner()
{
int i = COuter::ID;
}
};
} //!namespace
int main()
{
return 0;
}