Compilable Recursive Data Structure ( was: Recursive data structure using template won't compile)

Manfred Nowak svv1999 at hotmail.com
Thu Nov 8 13:15:17 PST 2012


Rob T wrote:

> In fact, I can define the structure just fine provided that I do not 
> use a template.

.. and if one uses a template one can get an infinite recursion, 
because templates include recursion. This is the case in your code.

The code I gave elimates that infinite recursion. The code compiles 
although it uses a template.

Not seeing e recursion does not mean that there is none. Not every 
recursion is as simple to see as:

| alias X Y;
| alias Y X;

-manfred 



More information about the Digitalmars-d-learn mailing list