digitalmars.D.learn - type suffix for character literal
- Ben Jones (6/6) Dec 07 2020 Are there suffices (suffixes?) for character literals?
- Adam D. Ruppe (4/7) Dec 07 2020 You should rarely need to since there's implicit casting. but I
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
Dec 07 2020
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.
Dec 07 2020