Template Class With Default Values

Mike Parker aldacron at gmail.com
Sun Mar 4 11:59:52 UTC 2018


On Sunday, 4 March 2018 at 11:35:23 UTC, bauss wrote:
> Why is the following not working?
>
> class Foo(string baz = "baz")
> {
>     mixin("int " ~ baz ~ ";");
> }
>
> class Bar : Foo
> {
> }
>
> Shouldn't it implicit do, without me having to do it manually?
>
> class Bar : Foo!"baz"
> {
> }
>

class Bar : Foo!()
{
}


More information about the Digitalmars-d-learn mailing list