Re: Cannot access template name from within template

2016-10-04 Thread Andrej Mitrovic via Digitalmars-d
On Tuesday, 4 October 2016 at 22:43:21 UTC, Andrei Alexandrescu wrote: On 10/04/2016 06:03 PM, Andrej Mitrovic wrote: template TemplateOf(T) Have you forgotten you submitted this to phobos? :o) -- Andrei I forgot about that template. But that wasn't me:

Re: Cannot access template name from within template

2016-10-04 Thread Andrei Alexandrescu via Digitalmars-d
On 10/04/2016 06:03 PM, Andrej Mitrovic wrote: template TemplateOf(T) Have you forgotten you submitted this to phobos? :o) -- Andrei

Re: Cannot access template name from within template

2016-10-04 Thread Andrej Mitrovic via Digitalmars-d
On Monday, 3 October 2016 at 22:28:46 UTC, Andrei Alexandrescu wrote: Any known workaround? If you're ok with the hacky approach: - import std.algorithm; import std.conv; /// these are in std.traits but private for whatever reason alias Identity(alias A) = A; alias parentOf(alias sym) =

Re: Cannot access template name from within template

2016-10-04 Thread Jacob Carlborg via Digitalmars-d
On 2016-10-04 04:22, Michael Coulombe wrote: You can also just do something like this, to search the upper/global scope: alias A = SomethingCool!(.MyStruct); Doesn't work for nested templates. -- /Jacob Carlborg

Re: Cannot access template name from within template

2016-10-03 Thread Michael Coulombe via Digitalmars-d
On Tuesday, 4 October 2016 at 00:40:08 UTC, Andrei Alexandrescu wrote: On 10/03/2016 06:32 PM, Stefan Koch wrote: On Monday, 3 October 2016 at 22:28:46 UTC, Andrei Alexandrescu wrote: Consider: template SomethingCool(alias X) { alias Y = X!int; } struct MyStruct(T) { alias A =

Re: Cannot access template name from within template

2016-10-03 Thread Andrei Alexandrescu via Digitalmars-d
On 10/03/2016 06:32 PM, Stefan Koch wrote: On Monday, 3 October 2016 at 22:28:46 UTC, Andrei Alexandrescu wrote: Consider: template SomethingCool(alias X) { alias Y = X!int; } struct MyStruct(T) { alias A = SomethingCool!MyStruct; } Inside MyStruct though, a mention of the symbol

Re: Cannot access template name from within template

2016-10-03 Thread Stefan Koch via Digitalmars-d
On Monday, 3 October 2016 at 22:28:46 UTC, Andrei Alexandrescu wrote: Consider: template SomethingCool(alias X) { alias Y = X!int; } struct MyStruct(T) { alias A = SomethingCool!MyStruct; } Inside MyStruct though, a mention of the symbol MyStruct alone is actually the current

Cannot access template name from within template

2016-10-03 Thread Andrei Alexandrescu via Digitalmars-d
Consider: template SomethingCool(alias X) { alias Y = X!int; } struct MyStruct(T) { alias A = SomethingCool!MyStruct; } Inside MyStruct though, a mention of the symbol MyStruct alone is actually the current instantiation - i.e. a type, not a template. Any known workaround? Thanks,