嗨,我正在尝试重载 operator<< 以挂钩
stream << std::endl;
如果我不需要输出,则避免附加 '\n' 。我已经超载了:
std::ostream& operator<< (std::ostream& (*pf)(std::ostream&))
std::ostream& operator<< (std::ios& (*pf)(std::ios&))
std::ostream& operator<< (std::ios_base& (*pf)(std::ios_base&))
但是通话总是在 basic_ostream 结束
_Myt& __CLR_OR_THIS_CALL operator<<(_Myt& (__cdecl *_Pfn)(_Myt&))
{// call basic_ostream manipulator
_DEBUG_POINTER(_Pfn);
return ((*_Pfn)(*this));
}