Public feed #890530

Miscellany

public text v1 · immutable
Raw Edit
·published 2008-02-03 20:37 UTC
rendered paste body
#include <cctype>
#include <string>
#include <iostream>
#include <algorithm>

int main(int argc, char** argv) {
        std::string s("foo");
        std::cout << std::count_if(s.begin(), s.end(), std::isalpha)
                  << std::endl;
	return 0;
}

/*

test.cpp: In function ‘int main(int, char**)’:
test.cpp:8: error: no matching function for call to ‘count_if(__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, <unknown type>)’

*/