2016-06-14 84 views
15

今天我遇到了這段代碼(boost/type_index/type_index_facade.hpp,第252-259行)。C++中操作符之間的逗號

/// noexcept comparison operators for type_index_facade classes. 
bool operator ==, !=, <, ... (const type_index_facade& lhs, const type_index_facade& rhs) noexcept; 

/// noexcept comparison operators for type_index_facade and it's TypeInfo classes. 
bool operator ==, !=, <, ... (const type_index_facade& lhs, const TypeInfo& rhs) noexcept; 

/// noexcept comparison operators for type_index_facade's TypeInfo and type_index_facade classes. 
bool operator ==, !=, <, ... (const TypeInfo& lhs, const type_index_facade& rhs) noexcept; 

有人可以解釋我是什麼意思?我像以前從未見過「==,=,<,...!」

+5

我不知道它是什麼,但不是C++。 – 101010

+0

@ 101010它是C++ 11 –

+1

@FirstStep這是無效的C++ 11,正如頂部答案 –

回答

32

你會發現,這些中寫道:

#if defined(BOOST_TYPE_INDEX_DOXYGEN_INVOKED) 
    ... 
#endif 

這僅僅是一個黑客,使doxygen的使用這些「簡化」的聲明在文檔中。這部分代碼從未編譯過。