On Saturday, 5 October 2019 at 00:39:03 UTC, Brett wrote:
is there a way to use a abstract this easily?

I'd just use a traditional function for it, a little three liner.

----
struct Foo {
        int longName;
}

// note ufcs only works when declared top level so it cant be nested in main.... but you could nest it if you called it C(foo), of course
auto C(ref Foo a) {
        return a.longName;
}
void main() {

        Foo foo;

        foo.C;
}
----

Reply via email to