Can anyone help me? may be the Argument-dependent lookup but I don't know how to resolve it. I have searched online and found that argument dependent lookup could be the issue and the definition in namespace std should help but it didnt or include string , include iostream, include vector also did not help.
The line commented in main function doesn't work. Do anyone know how to solve it?
Maybe use this standalone, non-member template function instead -
template< typename T1, typename T2>
std::ostream& operator <<(std::ostream& out, std::pair<T1, T2>& x)
return out << "(" << x.first << ", " << x.second << " )\n";
Still fails... other people said that the problem here is that i am trying to overload the operator << to work with std::ostream and std::pair<int, std::string>, neither of which is a user-defined type but i defined a structure
struct mine{
int a;
std::string b;
Still the same error.
std::ostream& operator <<(std::ostream& out, const mine& x) { . . . }
template< typename T1, typename T2>
std::ostream& operator <<(std::ostream& out, const std::pair<T1, T2>& x) { . . . }