Based on this PR: https://github.com/dlang/phobos/pull/7642 and issue 21233
parse gained an extra parameter which is a Flag, and that indicates whether the return should include a size_t of how many items were parsed.
However, the ordering of the new parameter makes it difficult to use, you have to specify the source type in order to get to the Flag parameter.
By adding additional overloads in the form:
parse(Target, Flag!"doCount", Source)(Source rng)
the flag is more accessible. I should not have to specify the Source type in order to specify the flag.
In fact, I think this could have been done with an overload originally, but at this point, code probably already exists that uses the form `parse!(long, typeof(s), Yes.doCount)(s)`
I don't think having both overloads would break any code. Types don't match values, values don't match types.
parse(Target, Source, Flag!"doCount" doCount)(Source rng) will match existing uses that specify the source range type explicitly
parse(Target, Flag!"doCount" doCount, Source)(Source rng) will match new uses that want to use IFTI to detect the Source range type.
What was discussed in that thread is inserting the flag in *existing* functions. I'm talking about adding overloads to address the new usage.
Comment #3 by robert.schadek — 2024-12-01T16:38:27Z