Function literals can't be class members

JS js.mdnq at gmail.com
Tue Jul 9 02:44:16 PDT 2013


On Monday, 8 July 2013 at 22:41:41 UTC, JS wrote:
> trying to use a lambda inside a sub template gives an error.
>
> mixin template a
> {
>    template b()
>    {
>       enum b = { }();
>    }
>    mixin(b!());
> }
>
> gives the error in the subject, removing the nesting or using a 
> function instead of a lamda produces no error, yet all are 
> essentially semantically equivalent... just the lamda version 
> requires less typing. (in fact, it would be nice to have a 
> simplification of template b() = { ... }();)

Anyone have any ideas?


More information about the Digitalmars-d mailing list