該類可用于支持游戲中的編輯器等需要使用變量名稱字符串訪問變量的功能。
使用示例如下:
//?PropertyUtility.cpp?:?Defines?the?entry?point?for?the?console?application.
// TestBase 與 TestDerived 是使用該支持庫實作的兩個例程類。

#include?"stdafx.h"
#include?"TestClass.h"
#include?<iostream>

int?_tmain(int?argc,?_TCHAR*?argv[])


{
????TestBase?tb;
????TestDerived?td;
????int?x;
????int?y?=?5;
????
????//測試基本存取
????//tb.Set(_T("testint3"),?y);?//warning:can't?find?property
????//tb.Set(_T("testint"),?float(y));?//assert:?type-error
????tb.Set(_T("testint"),?y);?//"testint"?=?5
????tb.Get(_T("testint"),?x);?//?x?=?5;
????//td.Set(_T("testint"),?x);?//assert:not?initialize;
????
????cout?<<?x?<<?endl;
????system("pause");
????return?0;
}
使用示例如下:


























