Re: construct range from tuple?

2016-09-18 Thread Lutger via Digitalmars-d-learn
On Sunday, 18 September 2016 at 09:36:13 UTC, e-y-e wrote: On Sunday, 18 September 2016 at 08:06:54 UTC, Lutger wrote: [...] Use std.range's 'only' function [1], it takes variadic arguments of the same type and constructs a range consisting of them. Example: import std.meta :

Re: construct range from tuple?

2016-09-18 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, September 18, 2016 09:36:13 e-y-e via Digitalmars-d-learn wrote: > Use std.range's 'only' function [1], it takes variadic arguments > of the same type and constructs a range consisting of them. > > Example: > > import std.meta : AliasSeq; > import std.range : only; >

Re: construct range from tuple?

2016-09-18 Thread e-y-e via Digitalmars-d-learn
On Sunday, 18 September 2016 at 09:36:13 UTC, e-y-e wrote: On Sunday, 18 September 2016 at 08:06:54 UTC, Lutger wrote: [...] Use std.range's 'only' function [1], it takes variadic arguments of the same type and constructs a range consisting of them. Example: import std.meta :

Re: construct range from tuple?

2016-09-18 Thread e-y-e via Digitalmars-d-learn
On Sunday, 18 September 2016 at 08:06:54 UTC, Lutger wrote: I have a tuple of strings generated at compile time, for example: alias names = AliasSeq!("Alice", "Bob"); How is it possible to construct a range of strings from this, in order to use it at runtime with other range algorithms?

Re: construct range from tuple?

2016-09-18 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 18 September 2016 at 08:06:54 UTC, Lutger wrote: I have a tuple of strings generated at compile time, for example: alias names = AliasSeq!("Alice", "Bob"); How is it possible to construct a range of strings from this, in order to use it at runtime with other range algorithms?

construct range from tuple?

2016-09-18 Thread Lutger via Digitalmars-d-learn
I have a tuple of strings generated at compile time, for example: alias names = AliasSeq!("Alice", "Bob"); How is it possible to construct a range of strings from this, in order to use it at runtime with other range algorithms? For example, this chain(names, ["Chuck"]) doesn't work as