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:
On 10/04/2016 06:03 PM, Andrej Mitrovic wrote:
template TemplateOf(T)
Have you forgotten you submitted this to phobos? :o) -- Andrei
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) =
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
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 =
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
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
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,