Re: How to stringify a template instantiation expression?

2018-03-02 Thread Yuxuan Shui via Digitalmars-d
On Thursday, 1 March 2018 at 17:48:02 UTC, Simen Kjærås wrote: On Thursday, 1 March 2018 at 16:46:30 UTC, Yuxuan Shui wrote: [...] string TemplateStringOf(T...)() if (T.length == 1) { import std.traits : TemplateOf, TemplateArgsOf; import std.meta : AliasSeq, staticMap; import

Re: How to stringify a template instantiation expression?

2018-03-01 Thread aliak via Digitalmars-d
On Thursday, 1 March 2018 at 16:46:30 UTC, Yuxuan Shui wrote: Did you actually try that? With dmd 2.079-rc1, this: template A(T...) {} struct B {} struct D {} struct E {} template C(T...) {} pragma(msg, (A!(B, C!(D, E))).stringof); Prints: A!(B, __T1CTS2ax1DTSQh1EZ) When compiled Yep,

Re: How to stringify a template instantiation expression?

2018-03-01 Thread Simen Kjærås via Digitalmars-d
On Thursday, 1 March 2018 at 16:46:30 UTC, Yuxuan Shui wrote: On Wednesday, 28 February 2018 at 15:49:25 UTC, aliak wrote: On Wednesday, 28 February 2018 at 15:09:56 UTC, Yuxuan Shui wrote: For a template instantiation expression like A!(B, C!(D, E)), I want to get a string "A!(B, C!(D, E))",

Re: How to stringify a template instantiation expression?

2018-03-01 Thread Yuxuan Shui via Digitalmars-d
On Thursday, 1 March 2018 at 16:46:30 UTC, Yuxuan Shui wrote: On Wednesday, 28 February 2018 at 15:49:25 UTC, aliak wrote: On Wednesday, 28 February 2018 at 15:09:56 UTC, Yuxuan Shui wrote: For a template instantiation expression like A!(B, C!(D, E)), I want to get a string "A!(B, C!(D, E))",

Re: How to stringify a template instantiation expression?

2018-03-01 Thread Yuxuan Shui via Digitalmars-d
On Wednesday, 28 February 2018 at 15:49:25 UTC, aliak wrote: On Wednesday, 28 February 2018 at 15:09:56 UTC, Yuxuan Shui wrote: For a template instantiation expression like A!(B, C!(D, E)), I want to get a string "A!(B, C!(D, E))", better if A, B, C, D, E is replaced by fully qualified name.

Re: How to stringify a template instantiation expression?

2018-02-28 Thread aliak via Digitalmars-d
On Wednesday, 28 February 2018 at 15:09:56 UTC, Yuxuan Shui wrote: For a template instantiation expression like A!(B, C!(D, E)), I want to get a string "A!(B, C!(D, E))", better if A, B, C, D, E is replaced by fully qualified name. Is this possible? A!(B, C!(D, E)).stringof I guess. Will

How to stringify a template instantiation expression?

2018-02-28 Thread Yuxuan Shui via Digitalmars-d
For a template instantiation expression like A!(B, C!(D, E)), I want to get a string "A!(B, C!(D, E))", better if A, B, C, D, E is replaced by fully qualified name. Is this possible?