2010-05-21 63 views

回答

4

你需要一個template template parameter

template < template <typename> class Container> void foo (Container<string>& stuff); 
+0

'模板類Container'。 – kennytm 2010-05-21 17:58:04

+0

是的,第二個類型名稱需要類,而它的工作原理。謝謝! – Kyle 2010-05-21 18:07:46

+2

該鏈接頁面的最後一句話是錯誤的。看到[我的問題](http://stackoverflow.com/questions/1469743/standard-library-containers-with-additional-optional-template-parameters) – 2010-05-21 18:09:09