[Issue 1462] Templated constructor not supported

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 9 10:32:09 PDT 2008


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.


-- 



More information about the Digitalmars-d-bugs mailing list