1
我想在地圖中存儲對不同對象的引用,但我不知道如何定義地圖。stl具有不同值類型的地圖?
e.g:
map<string, & ObjectReferenceOfAnyKind> myList;
myList[ "keyA", stringA);
myList[ "keyBlist", vector);
myList[ "file", fileObject);
string &value = (string&) myList["keyA"];
CFile &fobj = (CFile&) myList["file"];
任何建議如何解決此問題?
[http://www.boost.org/doc/libs/1_46_0/doc/html/any.html](boost::any)? – Damon 2011-03-31 14:54:36