2016-10-28 56 views
0

你好我試圖使用操作符重載< <掛接到重載流處理器運營商

stream << std::endl; 

避免「\ n」如果我不需要輸出附加。 我alredy重載:

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)); 
} 
+0

與其他類似std :: hex的操縱器一起工作 – heitho

回答

0

總是發現自己結束

的問題是,其他重載運算符返回的std :: ostream的&所以重載函數解無法呼叫。