Boost logo

Boost :

From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2024-01-23 18:05:13


On 1/23/24 20:25, Andrey Semashev wrote:
> On 1/23/24 20:14, Matt Borland via Boost wrote:
>>>
>>> Can I request that this library flips the defaults, so that
>>> boost::from_chars is 100%-compatible with std::from_chars, and you also get
>>> boost::from_chars_plus that behaves like strtod?
>>
>> Your reasoning is sound, and I have no issue with flipping them. In the docs I can highlight that the default behavior will likely change in the future based on whatever resolution LWG comes up with.
>
> I think I'd prefer that the "default" interface (that is, the one that
> users will likely use by default) to be the one that implements the
> "right" behavior (i.e. the behavior people find most useful) and keeps
> implementing that behavior regardless of the standard committee
> decisions on the standard.
>
> We recently had Boost.Scope review, and in its results it was
> highlighted that people generally prefer better interfaces to strict
> conformance with the standard. Boost libraries don't have to be strict
> implementation of the standard, especially when we can do better.

In fact, I will add that the behavior of the standard-complying
from_chars_strict should remain as it currently is, even after the
resolution of the LWG issue. This is so that users' code that relies on
this behavior would remain working even after the issue is resolved.

Similarly, the strtod-like from_chars should remain strtod-like
regardless if the LWG resolution so that users' core doesn't break.

Making one behavior the "default" only to then change it is the worst
you could do.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk