>> CharacterSet(const char * const c, size_t len) > > You do not want the len argument. These character sets will be nearly > always initialized once, from constant hard-coded c-strings. > For esoteric cases, I would add an add(const char c) method to add a > single character to the set (and use the merge operation to produce more > elaborate sets as needed, see below for a sketch).
Yes, but without it it's not possible to specify \0 as a valid character in the set. Possible solution: make len optional. If 0, default to strlen(). That would allow to cover one possible esoteric case without impacting the common case. What do you think? Kinkie