Код: Выделить всё
#include
#include
#include
#include
int main() {
std::string s("123");
std::all_of(s.begin(), s.end(), std::isdigit); //error!
}
Код: Выделить всё
error: no matching function for call to 'all_of'
note: candidate template ignored: couldn't infer template argument '_Predicate'
all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
Код: Выделить всё
#include
#include
#include
#include
int main() {
std::string s("123");
std::all_of(s.begin(), s.end(), isdigit); //OK
}
Я знаю, что isdigit из заголовка C Ctype.h , и что std :: isdigit - обертка, определенная в заголовке C ++ cctype , так что По сути, они должны быть такими же. Итак, в чем разница между ISDigit и std :: isdigit ?
Подробнее здесь: https://stackoverflow.com/questions/758 ... stdisdigit
Мобильная версия