Why can't structs be derived from?

Andrej Mitrovic andrej.mitrovich at gmail.com
Tue Mar 15 17:32:43 PDT 2011


On 3/15/11, dsimcha <dsimcha at yahoo.com> wrote:
> Something that has basically that effect is allowed, just not with that
> syntax:
>
> struct slist_node(T)
> {
>      slist_node base;
>      alias base this;
>
>      T data;
> }
>

Shouldn't base be a pointer? You'll get errors with that code.


More information about the Digitalmars-d mailing list