Re: Is this a compiler error? "recursive template expansion"

2020-12-08 Thread Nathan S. via Digitalmars-d-learn
On Tuesday, 8 December 2020 at 22:01:52 UTC, Basile B. wrote: On Tuesday, 8 December 2020 at 20:11:40 UTC, Nathan S. wrote: The following code fails to compile. Is this a compiler error or if not what is wrong with the code? What is wrong is that partial specialization is not correct. The

Re: Is this a compiler error? "recursive template expansion"

2020-12-08 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 8 December 2020 at 20:11:40 UTC, Nathan S. wrote: The following code fails to compile. Is this a compiler error or if not what is wrong with the code? What is wrong is that partial specialization is not correct. The correct partial specialization is: --- struct Template2(T) {

Is this a compiler error? "recursive template expansion"

2020-12-08 Thread Nathan S. via Digitalmars-d-learn
The following code fails to compile. Is this a compiler error or if not what is wrong with the code? --- struct Template2(T) { // If both of the following are removed compilation succeeds // without any other changes: enum tString = T.stringof; static if (is(T == class))