How to use isnan as a predicate function to std::find_if (c++11)
问题 I have a piece of code that is operating on a std::vector<double> cats and is doing something like this: std::find_if(cats.begin(), cats.end(), std::isnan<double>); this compiles under gcc before 4.3 but no longer compiles with gcc 4.7.2. I get an error like this: error: no matching function for call to 'find_if(std::vector<double>::iterator, std::vector<double::iterator, <unresolved overloaded function type>)' How can I get this to compile under newer gcc? And preferably also under the older