ref storage class in templates

Christian Kamm kamm.incasoftware at shift_at_left.de
Wed Apr 16 05:55:42 PDT 2008


Extrawurst Wrote:
>     call!(ref int)(&plus,val);
> dmd2.012: main.d(13): expression expected, not 'ref'

As the others have pointed out, it is intended behavior: storage classes are only valid in function parameter declarations and thus can't be passed to a template as a type parameter. 

You can pass 'ref int' within a type tuple using variadic template arguments for some reason, but I'm pretty sure that's useless (unless you resort to string mixins). See bugs 1818, 1411 and 1424 for related issues.

Christian




More information about the Digitalmars-d mailing list