I want to write a function that accepts any container containing strings. Something like that:
template <typename Container> void foo(Container<string>& stuff);
But this is not the correct syntax. What is the correct syntax?
You need a template template parameter :
template < template <typename> class Container> void foo (Container<string>& stuff);
Source: https://habr.com/ru/post/1746599/More articles:How to select text automatically inside a UIAlertView text field - highlightingSearch Algorithm (with already implemented sorting algorithm) - javaDoctrine + SQL Server Stored Procedures - databaseUnable to customize Explorer Explorer project context menu in VS 2010 - visual-studio-2010Qt and auto_ptr - c ++Django Form and Ownership - djangoTranslator with a single-mode virtual machine - you can evaluate all the math. expressions? - stackTkinter integration with glib mainloop - pythonGoogle App Engine, task queues - pythonКак использовать графический интерфейс NUnit с веб-сайтом С#/ASP.NET? - c#All Articles