On Tuesday, 1 September 2020 at 02:48:08 UTC, Ben Jones wrote:
Thanks all.
I tried using alias this at first and then I get errors trying
to construct AliasType objects:
auto pi = Payload!int(5);
auto pe = ParseError("error");
alias PRType = ParseResult!(Payload!int, ParseError);
auto pr =
On Tuesday, 1 September 2020 at 01:26:30 UTC, Paul Backus wrote:
Aside from using SumType directly in the function signature,
another workaround is to use a wrapper struct instead of an
alias:
struct AliasType(Args...) {
SumType!Args data;
alias data this;
}
boo
On Tuesday, 1 September 2020 at 01:11:35 UTC, Ben Jones wrote:
I have an alias that looks like
static if(...){
alias AliasType = SumType!(...);
}
which I use in a template constraint for a function template:
bool func(T: AliasType!Args, Args...)(T t){ ... }
When I try to call func with an
On 8/31/20 9:11 PM, Ben Jones wrote:
I have an alias that looks like
static if(...){
alias AliasType = SumType!(...);
}
which I use in a template constraint for a function template:
bool func(T: AliasType!Args, Args...)(T t){ ... }
When I try to call func with an AliasType object, the arg
I have an alias that looks like
static if(...){
alias AliasType = SumType!(...);
}
which I use in a template constraint for a function template:
bool func(T: AliasType!Args, Args...)(T t){ ... }
When I try to call func with an AliasType object, the argument
deduction fails with a message s