0
C++我定義了一個模板類。C++我定義了一個模板類。我可以看到實例化後出現的(源代碼)嗎?
我希望看到類實例化時產生的源代碼。例如,假設我有一個像std::vector
一類從標準庫:
template <typename T>
class Vector { ... } // this is in the .h and .inl
然後我初始化它
vector<int> v = new vector<int>();
我能看到聯的代碼,編譯器會創建?
編譯器不實際創建的文本形式的源代碼每個模板實例 - 所以不,你不能看到它。模板不是宏。 – 2014-09-06 19:27:58
沒有源代碼,模板實例化不是「純文本」步驟 – 2014-09-06 19:28:00
class Vector C++是一種區分大小寫的語言! – 2014-09-06 19:39:53