any_of not declared in this scope

Could anyone please shed some light on why 'any_of' would be throwing an error saying not declared in this scope?
I've got my #include <algorithm> in there, and also have find_last_not_of with no error.

I can't show the whole code as it's still a work in progress, but this is what it's in

1
2
3
bool checkDigits(string check){
  return any_of(check.begin(), check.end(), isdigit);
}


I've tried moving it to see if it's my function causing the error but I get the same thing. What am I missing please?

Thanks so much
Are you compiling with -std=c++17 or -std=c++1z ?

Edit: Didn't see the overload for c++11

Did you put std::any_of ?
Last edited on
any_of is part of the std namespace.

std::any_of

It's also part of C++11, so be sure you're using a compiler that supports it.
If your compiler doesn't support you can copy it from there:
http://www.cplusplus.com/reference/algorithm/any_of/
It must be my compiler (Mingw-4.7.1), which royally sucks arse cause I thought I was making progress >_<
Consider installing the latest version of Visual Studio Community , then you can have the latest of everything including the gcc and clang compilers.

https://blogs.msdn.microsoft.com/vcblog/2017/03/07/use-any-c-compiler-with-visual-studio/

Good Luck !!

Topic archived. No new replies allowed.