namespace CounterNameSpace {
int upperbound;
int lowerbound;
using namespace NS;//Error
}
namespace NS {
int i;
}
// ...
namespace NS {
int j;
}
在上述情况下,它显示了一个错误。 错误C2871:'NS':不存在此名称的命名空间。 我知道如果在counternamespace之前定义了NS,则问题将得到解决。但是,我想知道是否存在类似于C ++中的命名空间的前向声明的东西。这样可以在不在counternamespace之前定义NS的情况下解决上述问题。 请帮忙。