Given this code, is it possible to change dumpStrings()
to be able to iterate over any container of string
, like say a list
yes
http://www.boost.org/doc/libs/1_45_0/libs/utility/enable_if.html
http://www.cplusplus.com/reference/std/iterator/iterator_traits/
http://www.boost.org/doc/libs/1_44_0/libs/type_traits/doc/html/boost_typetraits/reference/is_same.html
template
typename enable_if<
is_same::value_type, string>
>::type
function(...