M
Marshall Mills
As I understand it, loaded statement, a using declaration should be all I
need to see an enum from within a namespace. The below code works fine with
class, struct, and union. What gives? As the code says, if I employ the
using directive, I'm ok.
/* built with Visual C++ 6, SP 5 */
namespace Traffic
{
enum Light { red, yellow, green };
}
int main( void )
{
/*using namespace Traffic; /* using directive. OK */
using Traffic::Light; /* using declaration. error C2065: 'red' :
undeclared identifier */
Light broken = red;
return broken;
}
need to see an enum from within a namespace. The below code works fine with
class, struct, and union. What gives? As the code says, if I employ the
using directive, I'm ok.
/* built with Visual C++ 6, SP 5 */
namespace Traffic
{
enum Light { red, yellow, green };
}
int main( void )
{
/*using namespace Traffic; /* using directive. OK */
using Traffic::Light; /* using declaration. error C2065: 'red' :
undeclared identifier */
Light broken = red;
return broken;
}