문제

I use GCC 4.1.2 on linux, and the STL must be SGI STL. After I wrote:

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

the compiler said:

error: ‘compose2’ was not declared in this scope

what's the matter?

도움이 되었습니까?

해결책

compose2 is not standard and is neither in the global nor std namespaces.

gcc ships some non-standard SGI extensions in the __gnu_cxx namespace.

Use __gnu_cxx::compose2, or boost has many of these predefined.

-nick

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top