January 30, 2007 Re: Conditional Templates | ||||
---|---|---|---|---|
| ||||
Posted in reply to Derek Parnell | "Derek Parnell" <derek@nomail.afraid.org> wrote in message news:2bjnrvcmm8o9$.k39bxr2x2c52$.dlg@40tude.net... > So it seems that D regards characters and > integers as interchangeable entities, which is just not correct. I know > that characters are implemented in memory as integers, but they are > conceptually different things, and just sometimes coders need to treat > them > as different things. I hate this too. I've ended up writing all kinds of ugly templates to deal with this problem. I also really like this one: static assert(is(bool : dchar)); This passes. This caused a very difficult-to-find bug in MiniD, because never in a million years would I have expected bool to be implicitly convertible to dchar. |
Copyright © 1999-2021 by the D Language Foundation