C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Restrict what std::to_string may throw

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Fri, 8 Mar 2024 13:21:12 +0000
On Fri, 8 Mar 2024 at 13:05, Jan Schultke via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> I have a micro-proposal:
>
> https://eisenwave.github.io/cpp-proposals/to-string-throws.html
>
> Is it possible to go straight to LWG with this? I don't believe this
> is editorial because it does change semantics. It's also not a defect
> so seemingly not fit for a mere LWG issue. So I guess it needs to be a
> proposal.
>
> However, it would be silly to push this through LEWG-I and LEWG for
> months when it's just a tiny wording change.


I think it would be better to add:

Throws: bad_alloc.

The proposal makes you do a lot more work to figure out the same
thing, because you have to determine that std::format_error isn't
possible in this case.

Received on 2024-03-08 13:22:30