On Thursday, 28 June 2018 at 09:42:54 UTC, Flaze07 wrote:
On Thursday, 28 June 2018 at 09:38:36 UTC, Stefan Koch wrote:
On Thursday, 28 June 2018 at 09:26:10 UTC, Flaze07 wrote:
On Thursday, 28 June 2018 at 08:52:33 UTC, Simen Kjærås wrote:
On Thursday, 28 June 2018 at 08:36:54 UTC, Flaze07 wrote:
is there some sort of ways to turn range into tuple ? ( an
array preferably )
e.g
uint[] arr = [ 10, 20, 30 ];
auto tup = rangeToTup( arr );
assert( tup[ 0 ] == 10 );
assert( tup[ 1 ] == 20 );
assert( tup[ 2 ] == 30 );
https://dlang.org/phobos/std_meta#aliasSeqOf
--
Simen
what about during runtime ?
Tuples are compile-time entities.
However if you just want an array use std.range.array.
that's interesting, thanks
the reason I am asking is that I want to do something similar to
this code in python :
a, b, c = input().split(' ')
because I feel like reading with readln is easier than readf