Here is a simplification of 6 std::tr1::regex_match
regex_match(iterator1, iterator2, match_results&, regex&, flags = some_default); regex_match(iterator1, iterator2, regex&, flags = some_default); regex_match(Elem*, match_results&, regex&, flags = some_default); regex_match(Elem*, regex&, flags = some_default); regex_match(string, match_results&, regex&, flags = some_default); regex_match(string, regex&, flags = some_default);
I wonder why the prototypes were designed this way:
- It seems that both
match_results and flags should be optional, but you should be able to provide one of them. Why not slide match_results & next to flags ? - The
regex & argument seems more intuitive as the main argument.
Can someone explain the rationale for these prototypes?
Thanks.
source share