Motive behind !empty() with front() instead of Optional front()

Per Nordlöw per.nordlow at gmail.com
Fri Mar 26 14:46:10 UTC 2021


On Friday, 26 March 2021 at 13:38:01 UTC, vitoroak wrote:
> I think one reason is that unlike Rust, D doesn't have a safe 
> way to return Optional!(ref T) so we need front and empty so 
> Ranges can return the items by reference.

Ahh, thanks.


More information about the Digitalmars-d mailing list