Polymorphic recursive class

Dmitry Olshansky via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 13 03:33:09 PDT 2015


On 13-Jul-2015 09:31, Jack Applegame wrote:
> This code doesn't compile, because recursive template expansion.
>
> class Nested(A) {
>    A left;
>    Nested!(A[]) right;

You might mean Nested!A[] ?

Else it looks like making a construct that is:

left - an element,
right - {
     left - an array,
     right - {
           left - an array of arrays,
           right - {
              left- an array of array of arrays
              right - an so on ... WTF?
           }
     }
}

Or is that what you intended?

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list