A
Andrew Ward
Hi,
The following code compiles fine for me, however I would have thought it
should return an error at least in foo(). Is there a good reason why the
using namespace N1; continues past the end of namespace N2?
namespace N1
{
class C1
{
public:
void f1() {}
};
}
namespace N2
{
using namespace N1;
class C2
{
C1 c;
void f2();
};
}
void N2::C2::f2()
{
C1 c;
c.f1();
}
void foo()
{
C1 c;
c.f1();
}
The following code compiles fine for me, however I would have thought it
should return an error at least in foo(). Is there a good reason why the
using namespace N1; continues past the end of namespace N2?
namespace N1
{
class C1
{
public:
void f1() {}
};
}
namespace N2
{
using namespace N1;
class C2
{
C1 c;
void f2();
};
}
void N2::C2::f2()
{
C1 c;
c.f1();
}
void foo()
{
C1 c;
c.f1();
}