編譯器錯誤 C2888
'identifier' : 符號無法在命名空間 'namespace' 內定義
屬於命名空間 A 的符號必須在封入 A 的命名空間中定義。
下列範例會產生 C2888:
// C2888.cpp
// compile with: /c
namespace M {
namespace N {
void f1();
void f2();
}
void N::f1() {} // OK: namspace M encloses N
}
namespace O {
void M::N::f2() {} // C2888 namespace O does not enclose M
}