Will this do? -------------------- struct A(T) { private T x; ref T get() { return x; } alias get this; } ---------------------