How to have alias this with an unaccessible member (x below).<div>Making the member private won't work as it'll disable all operations on said member.<br><div><br></div><div>----</div><div>struct A(T){</div><div> T x;</div>
<div> //private T x would prevent alias this from doing anything useful</div><div> alias x this; </div><div>}</div><div>void main(){</div><div> auto a=A!int;</div><div> a++;//should do a.x++;</div><div> static assert(!__traits(compiles,a.x)); // I want this to hold</div>
<div> </div><div>}</div><div><div>----</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div>