Am Fri, 07 Jun 2013 17:03:47 -0400 schrieb Andrei Alexandrescu <[email protected]>:
> On 6/7/13 4:52 PM, Mrzlga wrote: > > Hi guys, > > > > This is a small feature proposal. > > Please consider to add these to the language: > > > > cast(signed) > > cast(unsigned) > > http://dlang.org/phobos/std_traits.html#.unsigned > > We should prolly add signed() as well. Could you please author an > enhancement request (and at best a pull request too)? > > > Thanks, > > Andrei That made me scratch my head again. I thought std.traits contains non-modifying queries into the type system and std.typecons contains the _actions_ for type system trickery. In any case I wouldn't have searched std.traits for a function that gets stuff done. On the topic, I think that D's cast() does too many things in one. You can _accidentally_ cast away immutable for example and run into undefined behavior as per the language specs. At first I liked how D got rid of C's different casts, but on the long run it is too pragmatic for my taste. -- Marco
