www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - C++ Expected converted to idiomatic D

reply Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
In

https://www.youtube.com/watch?v=nVzgkepAg5Y

Andrei describes his proposal for STL `Expected` planned to be 
included in C++20.

Have anybody converted the C++ proposal to idiomatic D, yet?

Hopefully without the pointer-legacy which unfortunately was 
allowed into `std:optional`.

Andrei claims we should it as return types for non-throwing 
variants of parse() and to() in the works at

https://github.com/dlang/phobos/pull/6665
Aug 16 2018
next sibling parent Paul Backus <snarwin gmail.com> writes:
On Thursday, 16 August 2018 at 20:37:33 UTC, Per Nordlöw wrote:
 In

 https://www.youtube.com/watch?v=nVzgkepAg5Y

 Andrei describes his proposal for STL `Expected` planned to be 
 included in C++20.

 Have anybody converted the C++ proposal to idiomatic D, yet?

 Hopefully without the pointer-legacy which unfortunately was 
 allowed into `std:optional`.

 Andrei claims we should it as return types for non-throwing 
 variants of parse() and to() in the works at

 https://github.com/dlang/phobos/pull/6665
I've got a basic version up and running: https://github.com/pbackus/expected
Aug 27 2018
prev sibling parent reply John Colvin <john.loughran.colvin gmail.com> writes:
On Thursday, 16 August 2018 at 20:37:33 UTC, Per Nordlöw wrote:
 In

 https://www.youtube.com/watch?v=nVzgkepAg5Y

 Andrei describes his proposal for STL `Expected` planned to be 
 included in C++20.

 Have anybody converted the C++ proposal to idiomatic D, yet?

 Hopefully without the pointer-legacy which unfortunately was 
 allowed into `std:optional`.

 Andrei claims we should it as return types for non-throwing 
 variants of parse() and to() in the works at

 https://github.com/dlang/phobos/pull/6665
I get the feeling from the talk that Andrei has some opinions about how it should be done that aren't completely in line with what has been proposed for the C++ standard.
Aug 28 2018
parent Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
On Tuesday, 28 August 2018 at 10:18:29 UTC, John Colvin wrote:
 I get the feeling from the talk that Andrei has some opinions 
 about how it should be done that aren't completely in line with 
 what has been proposed for the C++ standard.
Anyhow my implementation at https://github.com/nordlow/phobos-next/blob/master/src/expected.d should match his C++ code in the lecture, AFAICT. My code doesn't depend on other modules an compiles very fast (~46 ms in my machine) (with DMD -debug -unittest).
Aug 28 2018