In the following code, let me accept using namespace boost for short.
As for character separation, only algorithm/string is_from_range allowed to serve the purpose:
split(vec,str, is_from_range(':',':'));
Alternatively, if lambda allowed:
split(vec,str, lambda::_1 == ':');
or if a dedicated predicate is prepared:
struct match_char { char c; match_char(char c) : c(c) {} bool operator()(char x) const { return x == c; } }; split(vec,str, match_char(':'));
Regarding string matching, as David Rodriguez mentioned, there doesn't seem to be a split . If iter_split enabled, perhaps the following code will fit the target:
iter_split(vec,str, first_finder("::"));
Isse wisteria
source share