Mutable enums

Steven Schveighoffer schveiguy at yahoo.com
Thu Nov 17 06:20:01 PST 2011


On Wed, 16 Nov 2011 18:25:48 -0500, Timon Gehr <timon.gehr at gmx.ch> wrote:

> 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);}

My use case is incomplete, I minimized it too much.  I will update it.

-Steve


More information about the Digitalmars-d-learn mailing list