名前空間 'w' は、"using namespace x::y::z;" を使用して名前空間 x::y::z にネストされたクラス 'z' を認識しませんでした。宣言。Visual Studio 2010 を使用しています。何が問題なのですか?
//...
namespace x
{
namespace y
{
namespace z
{
class z
{
public:
z(){};
};
}
}
}
using namespace x::y::z; // normal declaration
namespace x
{
namespace y
{
namespace w
{
class w
{
z object; // Here is the problem. Type 'z' is underlined in visual studio!
// When I did like this:
// x::y::z::z object;
// everything is compiling properly
};
}
}
}
int main()
{
z object; // no problem - I declared namespace above
x::y::z::z object2; // also no problem
return 1;
}