2012-08-30 48 views
2

我在linux上使用GCC 4.1.2,並且STL必須是SGI STL。 後,我寫道:爲什麼我不能使用函數適配器compose2?

#include <functional> 
std::find_if(PirateFlush, PirateFlush + size, 
       compose2(std::logical_and<bool>(), bind2nd(std::greater<UInt32>(), time), 
        bind2nd(std::less<UInt32>(), now))); 

編譯器說:

錯誤:「compose2」沒有在此範圍

什麼事宣佈?

+1

+1'PirateFlush'。沖洗那些海盜,matey。 –

+1

是什麼讓你認爲這是SGI STL?你自己安裝了嗎? – juanchopanza

回答

6

compose2是不標準的,既不是在全球範圍內,也不在std名稱空間。

gcc在__gnu_cxx命名空間中發佈了一些非標準SGI擴展。

使用__gnu_cxx::compose2,或boost有許多這樣的預定義。

-nick

相關問題