Discussion Thread: DIP 1029--Add throw as Function Attribute--Final Review

Sebastiaan Koppe mail at skoppe.eu
Sat Apr 18 14:17:23 UTC 2020


On Saturday, 18 April 2020 at 14:02:46 UTC, Paul Backus wrote:
> On Saturday, 18 April 2020 at 12:03:46 UTC, Jacob Carlborg 
> wrote:
>> void main()
>> {
>>     auto result = copy("foo", "bar");
>>
>>     if (!result.isValue)
>>         goto L1;
>>     L1:
>>         writeln(result.error);
>> }
>
> The big downside of this compared to exceptions is that you can 
> forget to check the return value of `copy`, whereas exceptions 
> cannot be ignored.

That part was only the lowered code.




More information about the Digitalmars-d mailing list