Re: Result Types and void usage

2016-07-15 Thread nik via Digitalmars-d-learn
On Friday, 15 July 2016 at 11:36:27 UTC, ag0aep6g wrote: On 07/15/2016 10:11 AM, nik wrote: [...] [...] [...] void is somewhat special. It can't be used to declare variables or as a parameter type. So you'll have to approach this a bit differently. You also can't have a struct constructor

Result Types and void usage

2016-07-15 Thread nik via Digitalmars-d-learn
Hi all, I've been using D for a week now to compare it to Rust as a replacement to C++. One thing I miss from Rust is https://doc.rust-lang.org/std/result/ and its companion https://doc.rust-lang.org/std/macro.try!.html They make for some nice syntax so I had a go at recreating them in D