template <class T>
class container
{
typedef list<T> ObjectList;
public:
~container()
{
for (typename ObjectList::iterator item = _Container.begin(); item != _Container.end(); item++)
{
if (*item)
delete (*item)
}
}
}
我如何可以自由通過刪除指針內容的容器項目? G ++不允許這種代碼模板化的STL容器
後。一些。真實。碼。 – dirkgently
這裏有一些簡單的編譯錯誤。請在解決簡單的錯誤後重新發布您的問題(如果您還有問題)。 – resolveaswontfix
_Container,你在哪裏定義了這個? – Satbir