[Issue 1462] Templated constructor not supported

Jarrett Billingsley jarrett.billingsley at gmail.com
Tue Sep 9 11:48:01 PDT 2008


On Tue, Sep 9, 2008 at 1:32 PM,  <d-bugmail at puremagic.com> wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=1462
>
>
> smjg at iname.com changed:
>
>           What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                 CC|                            |smjg at iname.com
>           Severity|normal                      |enhancement
>           Keywords|                            |spec
>
>
>
>
> ------- Comment #1 from smjg at iname.com  2008-09-09 12:32 -------
> The problem seems to be that the current D syntax doesn't support it:
>
> Constructor:
>        this Parameters FunctionBody
>
> Parameters:
>        ( ParameterList )
>        ( )
>
> The alternative would be
>
> class Foo
> {
>    template(T...) this {
>        this(T t) {}
>    }
> }
>
> except that this doesn't work because 'this' is a keyword, not an identifier.
>
>
> --
>
>

I think it's much more that templated methods cannot be virtual, and
constructors more or less have to be.


More information about the Digitalmars-d-bugs mailing list