digitalmars.D.learn - Eponymous template member from a template mixin
- Yuxuan Shui (11/11) Aug 04 2018 This doesn't work:
- Steven Schveighoffer (4/17) Aug 04 2018 I believe mixin templates introduce a new symbol namespace to a degree.
- Jonathan M Davis (5/27) Aug 04 2018 A prime example of this is how you can't introduce function overloads wi...
- Yuxuan Shui (3/20) Aug 04 2018 What is the rational behind this?
This doesn't work: template A() { void B() {}; } template B() { mixin A!(); } void main() { B!()(); } Is this intentional?
Aug 04 2018
On 8/4/18 4:10 PM, Yuxuan Shui wrote:This doesn't work: template A() { void B() {}; } template B() { mixin A!(); } void main() { B!()(); } Is this intentional?I believe mixin templates introduce a new symbol namespace to a degree. I doubt you would be able to do something like this. -Steve
Aug 04 2018
On Saturday, August 04, 2018 17:10:32 Steven Schveighoffer via Digitalmars- d-learn wrote:On 8/4/18 4:10 PM, Yuxuan Shui wrote:A prime example of this is how you can't introduce function overloads with a template mixin. - Jonathan M DavisThis doesn't work: template A() { void B() {}; } template B() { mixin A!(); } void main() { B!()(); } Is this intentional?I believe mixin templates introduce a new symbol namespace to a degree. I doubt you would be able to do something like this.
Aug 04 2018
On Saturday, 4 August 2018 at 21:10:32 UTC, Steven Schveighoffer wrote:On 8/4/18 4:10 PM, Yuxuan Shui wrote:What is the rational behind this?This doesn't work: template A() { void B() {}; } template B() { mixin A!(); } void main() { B!()(); } Is this intentional?I believe mixin templates introduce a new symbol namespace to a degree. I doubt you would be able to do something like this. -Steve
Aug 04 2018