I would like to iterate over a comma-separated list of strings and do things with each string. Is there a way to set boost::split to recognize both "abc,xyz" and "abc" as valid inputs? In other words, can Split return the entire input string if it the predicate doesn't match anything?
Or should I be using boost:tokenizer instead?
Boost 1.54 does exactly what you want. Haven't tried newer versions.
Example:
Produces: