Since an enum is essentially a typedef, it should perform similarly to alias this.
Example:
struct S(T)
{
T t;
}
void foo(T)(S!T item)
{
}
struct U {
S!int s;
alias s this;
}
enum V : S!int {
x = S!int(1)
}
void main()
{
S!int s;
U u;
foo(s); // ok
foo(u); // ok
//foo(V.x); // fails to compile
}
Comment #1 by robert.schadek — 2024-12-13T19:08:48Z