Tommi Mäkitalo <tommi@...> writes:
> Am 24.06.2013 21:38, schrieb Artem:
> > In addition to the Tommi's answer, there's also
> > http://www.boost.org/doc/libs/1_53_0/doc/html/string_algo.html
> >
> Yeah great. There is a split also:
>
> template<typename SequenceSequenceT, typename RangeT, typename
PredicateT>
> SequenceSequenceT &
> split(SequenceSequenceT & Result, RangeT & Input, PredicateT Pred,
> token_compress_mode_type eCompress= token_compress_off);
>
> You should really use that. Gosh - I would like to know how that works.
> And I thought I know C++.
>
> Sometimes I don't wonder at all, why some people hate C++.
>
> Tommi
Hey, it's just a thoroughly generic function. A JavaScript "function
split(result, input, predicate)" isn't better, I wouldn't know what to pass
it either. How it works is a question of documentation for a generic function.
The PredicateT is an extra layer of abstraction allowing to use, say,
regular expressions or locale-awayre predicates or whatever:
std::list<string> buf;
boost::split (buf, "123;456", !boost::is_digit(std::locale ("ru_RU")));
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general