Const/Immutable Slicing Syntax

Nordlöw via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Nov 22 00:27:41 PST 2016


What's the cleanest way of doing const or immutable slicing in D?

My first thought is

     cast((const typeof(x))x)[]
     cast((immutable typeof(x))x)[]

but that's too verbose for my/taste.

Is there a Phobos function for this?


More information about the Digitalmars-d-learn mailing list