Hi Dominique, Dominique Pelle wrote:
This following program shows many allocations coming from boost::split(..., boost::is_any_of(",")): When using boost::is_any_of(","), there are 7 dynamic allocations per loop iteration whereas when using the lambda predicate, there are 0 dynamic allocation per loop as shown below:
See this thread from 2008:
https://lists.boost.org/Archives/boost//2008/02/133396.php
There are some benchmarks in my reply here:
https://lists.boost.org/Archives/boost//2008/02/133415.php
I observed that C's strcspn was one of the better choices,
but it could be beaten for search sets known at compile time
with this:
template <char c0> bool is_any_of(char c) {
return (c==c0);
}
template