When compiling using gcc 4.7,r = engine->RegisterObjectMethod("string", "bool opEquals(const string &in) const", asFUNCTIONPR(operator==, (const string &, const string &), bool), asCALL_CDECL_OBJFIRST);
fails to compile.
GCC 4.7 has two operator== for basic_string and it doesn't know which one to use in that instance: template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __lhs.compare(__rhs) == 0; }
I'm not so sure I agree ;), but here it is: angelscript/sdk/add_on/scriptstdstring/scriptstdstring.cpp:518:86: error: invalid static_cast from type ‘<unresolved overloaded function type>’ to type ‘bool (*)(const string&, const string&) {aka bool (*)(const std::basic_string<char>&, const std::basic_string<char>&)}’
I would advise strong caution when using GCC 4.7.0 or GCC 4.7.1. The C++ standard library bundled with those version has a seriously broken ABI, particularly with respect to std::list and std::string. I suggest you stick to GCC 4.6 or GCC 4.7.2 or later.
Stephen M. Webb
Professional Free Software Developer
I would advise strong caution when using GCC 4.7.0 or GCC 4.7.1. The C++ standard library bundled with those version has a seriously broken ABI, particularly with respect to std::list and std::string. I suggest you stick to GCC 4.6 or GCC 4.7.2 or later.
i agree 4.7 has some standard library problems.
one that hurt me the most, unordered_map insert is in 4.7 is slower than std::map insert.