我想實現一個模板C++模板瓦特/指針 - 無法將模板參數
template <class object_t, long size, object_t nullObject>
class lf_deque
{
// ...
}
當我嘗試實例化這個模板,一個int,它編譯罰款,但如果我嘗試用實例指針我得到的錯誤:
could not convert template argument '0' to 'int*'
lf_deque<int, 10, 0> intDeque; // WORKS
lf_deque<int*, 10, 0> ptrDeque; // ERROR
任何想法或想法,爲什麼我會得到這種不一致?
什麼是編譯器?這在MSVC 2010編譯罰款。 – MSN
這是從海灣合作委員會4.5.2 – Jerunh