::isalpha(c); } }: class Delim

Автор admin Понедельник, 8 июня 2009 11:32

::isalpha(c); } }: class Delimiters : std::unary_function { std::string exclude: public: Deli miters О {} Delimiters(const std::strings excl) : exclude(excl) {} bool operator()(char c) { return exclude.find(c) == std::string::npos: } }: template class Tokenlterator : public std::iterator< std::input_iterator_tag,std::string, std::ptrdiff_t> { Inputlter first: Inputlter last: std::string word: Pred predicate: public: TokenlteratoKInputlter begin, Inputlter end. Pred pred = PredO) : first(begin), last(end). predicate(pred) { ++*this; } TokenlteratorO {} // Конечный итератор // Префиксный инкремент: TokenlteratorS operator++() { word.resize(O); first = std::find_if(first, last, predicate): while (first != last && predicate(*first)) word += *first++; return *this; } // Постфиксный инкремент class CaptureState { std::string word: public: CaptureStateCconst std::string& w) : word(w) {} std::string operator*() { return word; } }: CaptureState operator++(int) { CaptureState d(word): ++*this; return d; } // Разыменование (выборка значения): std::string operator


Комментарии закрыты.