I'm having problem in compilation of the following code snippet while using GNU g++ 4.9.2 (used to compile ok in g++ 2.95.3)
XOStream &operator<<(ostream &(*f)(ostream &)) {
if(f == std::endl) {
*this << "\n" << flush;
}
else {
ostr << f;
}
return(*this);
}
The error is as below:
error: assuming cast to type 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)' from overloaded function [-fpermissive]
[exec] if(f == std::endl) {
[exec] ^
Please guide/help.