Re: std.meta.Replace using index

2017-07-28 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 28 July 2017 at 22:06:27 UTC, Ali Çehreli wrote: I think it works: template replace(T) { template inside(Src...) { template from(Dst...) { import std.meta; enum f = staticIndexOf!(T, Src); static if (f == -1) { alias

Re: std.meta.Replace using index

2017-07-28 Thread Ali Çehreli via Digitalmars-d-learn
On 07/28/2017 12:04 PM, Ali Çehreli wrote: On 07/28/2017 01:22 AM, Nicholas Wilson wrote: Hi I want to replace each occurrence of a particular type in an AliasSeq with a type from another AliasSeq (the both have the same length) with the corresponding index i.e. (int long long float) (byte

Re: std.meta.Replace using index

2017-07-28 Thread Ali Çehreli via Digitalmars-d-learn
On 07/28/2017 01:22 AM, Nicholas Wilson wrote: Hi I want to replace each occurrence of a particular type in an AliasSeq with a type from another AliasSeq (the both have the same length) with the corresponding index i.e. (int long long float) (byte char double dchar) replacing long should

std.meta.Replace using index

2017-07-28 Thread Nicholas Wilson via Digitalmars-d-learn
Hi I want to replace each occurrence of a particular type in an AliasSeq with a type from another AliasSeq (the both have the same length) with the corresponding index i.e. (int long long float) (byte char double dchar) replacing long should yield (int char double float) std.meta.Replace