std::ostream& operator<<(std::ostream& os, const T& obj){// write obj to stream
return os;}
std::istream& operator>>(std::istream& is, T& obj){// read obj from stream
if( /* no valid object of T found in stream */ )is.setstate(std::ios::failbit);
return is;}
prog.cpp: In function ‘int main()’:prog.cpp:15:18: error: no matching function for call to ‘f(my_string)’prog.cpp:15:18: note: candidates are:prog.cpp:11:10: note: void f(my_string&)prog.cpp:11:10: note: no known conversion for argument 1 from ‘my_string’ to ‘my_string&’prog.cpp:12:10: note: void f(const char*)prog.cpp:12:10: note: no known conversion for argument 1 from ‘my_string’ to ‘const char*’