'unwrap envy' and exceptions
Paulo Pinto
pjmlp at progtools.org
Mon Sep 13 05:56:18 UTC 2021
On Sunday, 12 September 2021 at 22:50:49 UTC, Alexandru Ermicioi
wrote:
> On Sunday, 12 September 2021 at 15:53:16 UTC, IGotD- wrote:
>>
>> What about the C++ approach, return values that look like
>> exceptions.
>>
>> You probably have already seen it.
>> http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p0709r4.pdf
>>
>> We are allowed to "steal" from C++ if it is any good. Also it
>> can be good for interoperability.
>
> Feels like java throws statement, except the need to handle
> exception in the function that calls throwing function.
Java throws statement was based on CLU, Modula-3 and C++,
actually.
Herb's idea is based on how Swift does exceptions, and ironically
brings exception specifications back into C++, after their
removal on C++17, just written in a different form.
More information about the Digitalmars-d
mailing list