Re: Creating Tuple or AliasSeq

2017-04-07 Thread Graham Fawcett via Digitalmars-d-learn
On Friday, 7 April 2017 at 10:26:24 UTC, ANtlord wrote: On Friday, 7 April 2017 at 07:46:40 UTC, Ali Çehreli wrote: [...] I can't understand. Documentation of cartesianProduct points out about finite arrays. At least one of arrays must be a inifinte array. As far as I know finite arrays is `

Re: Creating Tuple or AliasSeq

2017-04-07 Thread ANtlord via Digitalmars-d-learn
On Friday, 7 April 2017 at 07:46:40 UTC, Ali Çehreli wrote: Here is a solution: auto objectFactory(ObjectType, Args...)(Args args) { import std.algorithm : cartesianProduct, map; import std.array : array; return cartesianProduct(args).map!(a => ObjectType(a.expand)).array; } str

Re: Creating Tuple or AliasSeq

2017-04-07 Thread ANtlord via Digitalmars-d-learn
On Friday, 7 April 2017 at 07:46:40 UTC, Ali Çehreli wrote: Here is a solution: auto objectFactory(ObjectType, Args...)(Args args) { import std.algorithm : cartesianProduct, map; import std.array : array; return cartesianProduct(args).map!(a => ObjectType(a.expand)).array; } str

Re: Creating Tuple or AliasSeq

2017-04-07 Thread Ali Çehreli via Digitalmars-d-learn
On 04/06/2017 10:43 PM, ANtlord wrote: Hello! I've got an issue related to making a Tuple or AliasSeq using income template arguments. I want to create template makes an array of objects from array of arrays have different sizes and different types of values. Here is a solution: auto objectFac