W
Werner
Hi All,
I've (mistakenly) done this (see below) and was surprised to
see the compiler (comeau and gcc) accept it. Is this acceptable (I
can't
see why not)?
#include <iostream>
struct Base
{
struct Nested
{
void foo();
};
};
struct Derived : Base
{
};
void Derived::Nested::foo()
{
std::cout << "foo()";
}
int main()
{
Base::Nested n;
n.foo();
}
Kind regards,
Werner
I've (mistakenly) done this (see below) and was surprised to
see the compiler (comeau and gcc) accept it. Is this acceptable (I
can't
see why not)?
#include <iostream>
struct Base
{
struct Nested
{
void foo();
};
};
struct Derived : Base
{
};
void Derived::Nested::foo()
{
std::cout << "foo()";
}
int main()
{
Base::Nested n;
n.foo();
}
Kind regards,
Werner