I am trying to use template template parameters, similar to what is done here and here (and many other places).
#include
template
There is another thing you can do instead of modifying the function definition, i.e. use template alias to adapt std::vector
:
#include
#include
template<
template class A,
class B
>
void f(A &value) {
for( auto & x : value ) {
std::cout << x << std::endl;
}
}
template< class T >
using VectorAdapter = std::vector;
int main() {
VectorAdapter value {1, 2, 3};
f(value);
}