I define a lists like this:
std::list < pair<string, int> > token_list;
I want to print out all list elements, so I write it out:
std::copy(std::begin(token_list),
std::end(token_list),
std::ostream_iterator<pair<string, int> >(std::cout, " "));
But I've been getting this error:
error 2679:binary "<<"the operator (or unacceptable conversion) that accepts the right operand oftype (or unacceptable)
in Visual Studio. How can I fix it,or is there any other way to print out all pairs in a list?