On Tuesday, 10 July 2018 at 13:28:42 UTC, Yuxuan Shui wrote:
On Tuesday, 10 July 2018 at 11:37:25 UTC, ag0aep6g wrote:
On 07/10/2018 11:56 AM, Yuxuan Shui wrote:
Possible alternatives:
* struct Void {}. Takes 1 byte, not as ideal
* alias Void = AliasSeq!(). Doesn't work as template
argument.
On Tuesday, 10 July 2018 at 11:37:25 UTC, ag0aep6g wrote:
On 07/10/2018 11:56 AM, Yuxuan Shui wrote:
Possible alternatives:
* struct Void {}. Takes 1 byte, not as ideal
* alias Void = AliasSeq!(). Doesn't work as template argument.
i.e.
SomeTemplate!Void; // actually become
On 07/10/2018 11:56 AM, Yuxuan Shui wrote:
Possible alternatives:
* struct Void {}. Takes 1 byte, not as ideal
* alias Void = AliasSeq!(). Doesn't work as template argument. i.e.
SomeTemplate!Void; // actually become SomeTemplate!()
What about `void[0]`? It's a proper type. You can
On Tuesday, 10 July 2018 at 09:50:45 UTC, Yuxuan Shui wrote:
Suppose I want to create a type to contain either a return
value or an error, I could probably do something like this:
[...]
Breaking changes:
void[] x;
pragma(msg, x[0].sizeof); // now 0?
On Tuesday, 10 July 2018 at 09:50:45 UTC, Yuxuan Shui wrote:
Suppose I want to create a type to contain either a return
value or an error, I could probably do something like this:
[...]
Possible alternatives:
* struct Void {}. Takes 1 byte, not as ideal
* alias Void = AliasSeq!(). Doesn't
Suppose I want to create a type to contain either a return value
or an error, I could probably do something like this:
struct Result(T, E) {
bool is_err;
union {
T result;
E error;
}
}
This will probably work fine, unless I don't need an