assignments in mixins

Serg Kovrov kovrov at no.spam
Tue Aug 15 07:31:36 PDT 2006


Hello everybody,

If this mixin example works:

> template Foo(T)
> {
>     T x = 5;
> }

Why this one not:

> template Foo(T)
> {
>     T x;
>     x = 5; // <- error: no identifier for declarator x
> }

On page describing mixins I never saw an example with assignment inside 
mixin body, is it limitation of language or bug?

Thanks.

--
serg.



More information about the Digitalmars-d-learn mailing list