Re[5]: error:ptr_fun(<unknown type>)
От: Анатолий Широков СССР  
Дата: 03.10.05 19:48
Оценка:
Хорошо, для начала откажемся от using namespace std. Что скажет gcc на это?


#include <functional>
#include <algorithm>
#include <cctype>
#include <iostream>
#include <string>


inline bool is_num(std::string const &s)
{
  return  std::find_if(
      s.begin(),
      s.end(),
      std::not1(std::ptr_fun(std::isdigit))
   )  == s.end();
}

int main()
{
     std::cout << is_num("121212");
     return 0;
}
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.