On Friday, 8 August 2025 at 04:40:14 UTC, Andrey Zherikov wrote:
I have a template similar to `sumtype.match`:
```d
--- s.d
struct S {}
template match(A...)
{
auto match(S){return 1;}
}
--- main.d
//import std.sumtype; // uncomment to get error
import s;
void main()
{
S s;
asser
I have a template similar to `sumtype.match`:
```d
--- s.d
struct S {}
template match(A...)
{
auto match(S){return 1;}
}
--- main.d
//import std.sumtype; // uncomment to get error
import s;
void main()
{
S s;
assert(s.match!(_ => _) == 1);
}
```
If I uncomment `import std.symtype
On Thursday, 7 August 2025 at 17:38:41 UTC, monkyyy wrote:
On Thursday, 7 August 2025 at 17:33:07 UTC, monkyyy wrote:
Note I believe `getBargs` will break if H ever doesnt contain a
T so despite your trying to hide implementation details your
exposing them all the same
Thanks for your ans
On Thursday, 7 August 2025 at 16:58:34 UTC, Andrey Zherikov wrote:
On Wednesday, 6 August 2025 at 23:58:03 UTC, monkyyy wrote:
```d
struct A(T) {}
struct H(T) {}
alias B(T) = A!(H!T);
void f(T)(A!(H!T) b) {}
void g(T)(A!T b) {}
void h(B_)(B_ b)if(is(B_==A!(H!T),T)){}
unittest{
f(B!string.i
On Thursday, 7 August 2025 at 17:33:07 UTC, monkyyy wrote:
Note I believe `getBargs` will break if H ever doesnt contain a T
so despite your trying to hide implementation details your
exposing them all the same
On Wednesday, 6 August 2025 at 23:58:03 UTC, monkyyy wrote:
```d
struct A(T) {}
struct H(T) {}
alias B(T) = A!(H!T);
void f(T)(A!(H!T) b) {}
void g(T)(A!T b) {}
void h(B_)(B_ b)if(is(B_==A!(H!T),T)){}
unittest{
f(B!string.init);
g(B!int.init);
h(B!bool.init);
}
```
I dont think you