Ascii string literal.

Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 6 18:37:30 PDT 2016


On Fri, 06 May 2016 21:57:22 +0000
"Adam D. Ruppe via Digitalmars-d-learn"
<digitalmars-d-learn at puremagic.com> wrote:

> On Friday, 6 May 2016 at 21:39:35 UTC, Anonymouse wrote:
> > Is this different from what std.string.representation does?
>
> No, it does the same thing, but with your own function the
> intention may be clearer (or you could do a template to avoid any
> function or custom types too)

In general, it's better to use representation than to cast, because
representation gets the constness right, whereas if you cast, there's always
the risk that you won't.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list