October 05, 2015 Re: Idioms you use | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marco Leise | On 10/05/15 17:53, Marco Leise via Digitalmars-d wrote: > Am Sun, 04 Oct 2015 00:08:39 +0200 > schrieb Artur Skawina via Digitalmars-d > <digitalmars-d@puremagic.com>: > >> static ctfe = ctfeArr!( iota(256).map!isDigit() ); >> >> immutable typeof(R.front)[R.array().length] ctfeArr(alias R) = R.array(); > > I like that. Also that 1) In D everything is possible. And 2) > If not, there is a workaround, goto 1). Note that I just wanted to show that the ctfeArr /function/ was not necessary, and I didn't want that `ctfe` declaration to be affected; real code would look more like: enum typeof(R.front)[R.array().length] ctfeArr(alias R) = R.array(); immutable ctfe = ctfeArr!( iota(256).map!isDigit() ); artur |
Copyright © 1999-2021 by the D Language Foundation