Article ID: 167321
Article Last Modified on 12/10/2003
/*
Compile Options: /GX
*/
# include <iostream>
using namespace std ;
struct CMyClass
{
virtual void DoSomething()
{
cout << "::CMyClass::DoSomething()\n";
}
};
namespace MyNameSpace
{
struct CMyClass
{
virtual void DoSomething()
{
cout << "MyNameSpace::CMyClass::DoSomething()\n";
}
};
}
int main()
{
MyNameSpace::CMyClass().DoSomething() ;
// Workaround: Comment the line above,
// Uncomment the following lines
// MyNameSpace::CMyClass C1 ;
// C1.DoSomething();
return 0;
}
Additional query words: namespace
Keywords: kbbug kbfix kbnoupdate kblangcpp kbcpponly kbcode kbcompiler KB167321