A few questions

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Jun 30 00:45:19 UTC 2020


On 6/29/20 6:58 PM, aliak wrote:
> On Monday, 29 June 2020 at 16:56:37 UTC, Andrei Alexandrescu wrote:
>> On 6/26/20 10:30 PM, Yatheendra wrote:
>>> [...]
>>
>> I think the first order of business would be to have a nothrow core 
>> that defines correcntess of inputs as preconditions. The rest of the 
>> library can use it underneath. For example maxElement would have a 
>> precondition that the range is not empty etc.
>>
>> That also means finding new ways for APIs. std.conv.to would need a 
>> lambda to call if conversion fails, thus pushing policy to the caller.
> 
> Or return a SumType/Either/Expected/etc?

Affirmative!


More information about the Digitalmars-d mailing list