1
是否有服用類型的模板類的方式,例如以類型的模板類
//i have template function
template<typename T>
IData* createData();
//a template class instance
std::vector<int> a;
//using type of this instance in another template
//part in quotation mark is imaginary of course :D
IData* newData = createData<"typeOf(a)">();
是否有可能在C++?或者是有替代
不太清楚你想要什麼。您是否試圖從std :: vector中提取int類型,以便爲CreateData函數指定的類型是int而不是std :: vector ? –
Kei
2009-06-27 20:14:05