Trying to forward unwrapped opDispatch names to alias this

Adam D. Ruppe destructionator at gmail.com
Mon Feb 19 01:00:23 UTC 2018


On Monday, 19 February 2018 at 00:42:05 UTC, aliak wrote:
> struct B(T) {
>     T t;
>     A a;
>     alias a this;
>     auto opDispatch(string name)() if (hasMember!(T, name)) {
>         return mixin("t." ~ name);

Did you perhaps mean `A` instead of `T` here? cuz in your code T 
is int, not the struct.


More information about the Digitalmars-d-learn mailing list