Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top