Greetings.
I wanna write a template function that accepts any container type (such as vector, set, list) but restricts the element type of the container to be string.
I've tried this, but failed.
error: ‘C’ is not a templateCode:#include <iostream> #include <vector> #include <string> using namespace std; template <typename C> void t(C <string>* args) { } int main() { vector<string> vi; t(&vi); return 0; }
void t(C <string>* args)
Please kindly help. Thank you.