Mutable enums

Timon Gehr timon.gehr at gmx.ch
Wed Nov 16 15:25:48 PST 2011


On 11/16/2011 11:39 PM, Timon Gehr wrote:
> I think this is a better solution:
>
> void foo2(T: ParameterTypeTuple!foo[0])(T t){foo(t);}
>
> Then it is just a matter of applying proper value range propagation for
> IFTY:
>
> void bar(T: short)(T t){...}
>
> void main(){
> bar(1); // ok
> }
>

BTW, this already works for your use case:

void foo2(ParameterTypeTuple!foo t){foo(t);}




More information about the Digitalmars-d-learn mailing list