Boost logo

Boost :

From: Matt Borland (matt_at_[hidden])
Date: 2024-01-17 08:16:31


> After reading this and the related issue
> (https://github.com/cppalliance/charconv/issues/110) I actually strongly
> oppose the existing macro BOOST_CHARCONV_STD_ERANGE.
>

> It doesn't change the behavior of the users application but that of the
> compiled (Boost) library. And if given a compiled library there is a) no
> way to know the actual behavior of `from_chars` and b) there could be(?)
> ODR violations when using the library statically.
>

> As it seems to be only about whether the pass-by-reference value is
> modified it seems to be trivial to implement a wrapper around
> `boost::charconv::from_chars`, that is basically
> https://github.com/cppalliance/charconv/pull/111/files#diff-de4e106c6573193362b976fb5f98a6ad5fe43f34f0fae6c09098a96c3bed4ac3R61-R71
> I would even go as far as prodiving that function in Boost::CharConv,
> e.g. as `from_chars_strict` which could probably even be a template.
>

> To reiterate: Having the BOOST_CHARCONV_STD_ERANGE macro (and similar
> ones) makes the behavior of from_chars unpredictable which to me would
> be a reason to reject the library. To me it would be better to have
> "wrong" behavior than unknown behavior.
>

> Alex

Originally I was not keen on adding additional functions, but you're right this macro could make things non-deterministic. I'll revert the change, and add `from_chars_strict` instead.

Matt






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