我在linux上使用的是GCC 4.1.2,STL必须是SGI STL。在我写完之后:
#include <functional>
std::find_if(PirateFlush, PirateFlush + size,
compose2(std::logical_and<bool>(), bind2nd(std::greater<UInt32>(), time),
bind2nd(std::less<UInt32>(), now)));编译器说:
错误:未在此范围内声明‘compose2’
你怎么了?
发布于 2012-08-30 13:19:24
compose2不是标准的,既不在全局名称空间中,也不在std名称空间中。
gcc在__gnu_cxx名称空间中提供了一些非标准的SGI扩展。
使用__gnu_cxx::compose2,或者boost有许多这样的预定义。
-nick
https://stackoverflow.com/questions/12190069
复制相似问题