December 07, 2020 type suffix for character literal | ||||
---|---|---|---|---|
| ||||
Are there suffices (suffixes?) for character literals? Is there a more succinct of writing "the literal 'x' as a dchar" than dchar('x')? I didn't see anything https://dlang.org/spec/lex.html#characterliteral but figured I'd ask the community |
December 08, 2020 Re: type suffix for character literal | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ben Jones | On Monday, 7 December 2020 at 22:26:52 UTC, Ben Jones wrote: > Are there suffices (suffixes?) for character literals? nope. > Is there a more succinct of writing "the literal 'x' as a dchar" than dchar('x')? You should rarely need to since there's implicit casting. but I think that is the best way if you do need to. |
Copyright © 1999-2021 by the D Language Foundation