2

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?

jogojapan
  • 68,383
  • 11
  • 101
  • 131
user1400047
  • 247
  • 2
  • 10

1 Answers1

6

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

jogojapan
  • 68,383
  • 11
  • 101
  • 131
mythagel
  • 1,789
  • 19
  • 15