Original Post
I have a console class with pointers to cin and cout. I have this function: Which gives me the errors: ambiguous overload for 'operator<<' in 'console << "\n"' std::ostream& operator<<(Console&, T&) [with T = const char[2]] How should I fix this? Thanks
template<class T>
Console & operator << ( Console & console, T & writeObj)
{
console.outstream << writeObj;
return console;
}
int main()
{
string str = " hello ";
Console console;
console << "\n" << str << "\n";
}