Not super-keen on doing that because it involves some arbitrary decisions, e.g. is an empty string valid, is it ok if there are some unparsed characters on the end? etc.
I generally use other functions like CharacterFunctions::readDoubleValue() or when I'm parsing a string, also because it's often a lot more efficient to work with a CharPointer_UTF8 than a String in a lot of the situations where you end up doing this kind of thing.
It doesn't report an error, but it leaves the CharPointer at the end of the string, so you can see whether it parsed any characters, and whether there's any more to be read.
Everywhere I've ever had to parse a number has had a different requirement for error checking. I've no idea what a standard check would look like, or what should be considered a "normal" error.
For example "3," would be an error (probably) if you're just parsing a single number, but if you're parsing the tokens in a coordinate, it's fine. It's also fine in countries where they use a comma as a decimal place. Parsing "1.0" is fine for a double, but is it an error if you want an int? Is "+2" an error, if sometimes you don't want the "+" to be allowed? Is "123e1" an integer followed by garbage, or is it scientific notation? Is a 500-digit number an error? These are just the first handful of edge-cases I could think of, but there'll be many more!
Sorry, but I thought I made a pretty good case here!
The current implementation doesn't have any internal idea of whether the parse was "OK". So to add this "OK" flag that you want, I'd need to add logic to decide whether this string was indeed "OK" and I honestly don't know what that test would look like!
Anything I was to add would certainly be wrong/incomplete/controversial for some people/circumstances and would start an endless stream of requests: "can you make this method reject/accept [some new edge case]"... And it'd also slow down the implementation of a function that is needed in many performance-sensitive places.
The request you should be making is for a function e.g. isValidNumber (StringRef, ValidNumberOptions). That'd be handy, but not something we have time to do right now..
AFAIK that function is there since ever. The question was to add a flag to check the validity.
We have new tools as std::optional for instance nowadays.
But i doubt it worth the cost in that case.