3
因爲一個類裏面靜態常量數據實際上只是命名空間糖常量我認爲添加靜態常量數據的結構已經定義
struct A {
float a;
struct B {
static const int b = 2;
};
};
將相當於
struct A {
float a;
};
struct A::B {
static const int b = 2;
};
什麼類似。在C++中可以這樣做嗎?對於我來說,使用這樣的信息來標記我從第三方庫中抽取的類定義會很有用。
您有什麼具體要求?第一個塊相當於'struct A {float a;結構B; }; struct A :: B {static const int b = 2; };' – 2010-05-16 23:19:44