template <typename CONTAINER_TYPE, typename CONTAINER_VALUE_TYPE> bool FindAndErase(CONTAINER_TYPE& cont, const CONTAINER_VALUE_TYPE& value) { CONTAINER_TYPE::iterator it = eastl::find(cont.begin(), cont.end(), value); if (it != cont.end()) { cont.erase(it); return true; } return false; }
This code compiles in Visual C ++ 2005, but compiles using the ARM compiler ("ARM C / C ++ Compiler, RVCT4.0") and iOS gcc ("arm-apple-darwin9-gcc (GCC) 4.2.1" ) returns errors:
Error: # 65: expected a ;; Error: # 20: identifier "it" is undefined
in the 4th and 5th lines, respectively.
What is wrong with this code?
source share