<div>So I keep finding myself in a situation where I need to use an alias template arg, but what I actually want to alias is a MEMBER of some symbol, or even a function local.</div><div><br></div><div>struct MyStruct</div>
<div>{</div><div>   int x;</div><div>}</div><div><br></div><div><div>template Thing(alias t)</div><div>{</div><div>  ...</div><div>}</div><br class="Apple-interchange-newline"></div><div>MyStruct s;</div><div><br></div><div>
Thing!(s); // this is fine</div><div>Thing!(s.x); // this doesn't work</div><div><br></div><div>This seems like it should work intuitively, I was very surprised when it didn't. 's.x' can be resolved just as easily as 's' at compile time, but Walter said 'alias' could only understand absolute symbols, not symbol + offset.</div>
<div>Has anyone else run into this? What's the reason for the restriction?</div><div><br></div><div><div>I've also found I need to do this on a number of occasions: template Thing(alias T...)</div><div>Ie, receive an unknown number of aliases... But that doesn't work either.</div>
</div>