Re: turn range into tuple ?

2018-06-28 Thread Flaze07 via Digitalmars-d-learn
On Thursday, 28 June 2018 at 09:47:07 UTC, Jonathan M Davis wrote: On Thursday, June 28, 2018 09:26:10 Flaze07 via Digitalmars-d-learn wrote: On Thursday, 28 June 2018 at 08:52:33 UTC, Simen Kjærås wrote: > [...] what about during runtime ? Ranges in general have an arbitrary length,

Re: turn range into tuple ?

2018-06-28 Thread Flaze07 via Digitalmars-d-learn
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

Re: turn range into tuple ?

2018-06-28 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, June 28, 2018 09:26:10 Flaze07 via Digitalmars-d-learn 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 > >>

Re: turn range into tuple ?

2018-06-28 Thread Flaze07 via Digitalmars-d-learn
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

Re: turn range into tuple ?

2018-06-28 Thread Stefan Koch via Digitalmars-d-learn
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

Re: turn range into tuple ?

2018-06-28 Thread Flaze07 via Digitalmars-d-learn
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

Re: turn range into tuple ?

2018-06-28 Thread Stefan Koch via Digitalmars-d-learn
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 ); I think you

Re: turn range into tuple ?

2018-06-28 Thread Simen Kjærås via Digitalmars-d-learn
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

turn range into tuple ?

2018-06-28 Thread Flaze07 via Digitalmars-d-learn
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 );