dchar literals?

Philippe Sigaud philippe.sigaud at gmail.com
Mon Nov 11 04:49:26 PST 2013


On Sun, Nov 10, 2013 at 10:42 PM, Jonathan M Davis <jmdavisProg at gmx.com>wrote:
>
>
> I always do the cast, though honestly, I think that character literals
> should
> default to dchar rather than char. I'm not sure that we could ever talk
> Walter
> into that though, particularly if he thought that doing so would break code
> (I'm not sure whether it would or not, but using char for a character is
> almost always a bad idea, so defaulting to char for character literals just
> doesn't make sense to me).
>
> I'm not aware of there being a shorter way to get character literal to be
> dchar, though I suppose that if you had to do it a lot, you could create a
> function with a short name. e.g.


OK, thanks. I'll go with the cast, as this way anyone reading the code will
be clear on what is happening there.

And I agree with you than character literals should default to dchar. It's
a perpetual source of friction for me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20131111/14c238cc/attachment-0001.html>


More information about the Digitalmars-d-learn mailing list