GNU g++ 4.9.2 を使用しているときに、次のコード スニペットのコンパイルに問題があります (g++ 2.95.3 で正常にコンパイルするために使用されます)。
XOStream &operator<<(ostream &(*f)(ostream &)) {
if(f == std::endl) {
*this << "\n" << flush;
}
else {
ostr << f;
}
return(*this);
}
エラーは次のとおりです。
error: assuming cast to type 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)' from overloaded function [-fpermissive]
[exec] if(f == std::endl) {
[exec] ^
ガイド/ヘルプしてください。