class template conflict

Daniel Kozak kozzi11 at gmail.com
Mon Dec 24 22:55:55 UTC 2018


ne 23. 12. 2018 13:10 odesílatel Michelle Long via Digitalmars-d-learn <
digitalmars-d-learn at puremagic.com> napsal:

> class X
> {
>
> }
>
> class X(int N) : X
> {
>
> }
>
> Is there any real reason we can't do this?

Actually yes.  It would break almost all of my code.

In D you can do thing like this:
class X(int N)
{
X something; // it is same as X!N something;
}

So I do not need to write X!N everywhere inside X class template
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20181224/941a429c/attachment.html>


More information about the Digitalmars-d-learn mailing list