digitalmars.D.learn - In need for CommonOriginalType
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (9/9) May 02 2014 In order to make
- Joseph Rushton Wakeling via Digitalmars-d-learn (4/6) May 02 2014 Won't it work to use,
- =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= (7/9) May 02 2014 I need it to be variadic.
- Joseph Rushton Wakeling via Digitalmars-d-learn (2/7) May 02 2014 ... missing a closing bracket there :-P
In order to make https://github.com/nordlow/justd/blob/master/enums.d more type-safe (restrict type arguments to EnumUnion) I need a type trait, say, CommonOriginalType(E...) Do I have to use recursion (like in CommonType) to implement this or is there a better way? See also: http://forum.dlang.org/thread/bjburcdtcejohtpmqmay forum.dlang.org?page=2#post-lveiwblfoommtjninxki:40forum.dlang.org
May 02 2014
On 02/05/14 19:24, "Nordlöw" via Digitalmars-d-learn wrote:Do I have to use recursion (like in CommonType) to implement this or is there a better way?Won't it work to use, is(CommonType!(OriginalType!T1, OriginalType!T2) ... ?
May 02 2014
is(CommonType!(OriginalType!T1, OriginalType!T2) ... ?I need it to be variadic. I cracked it: import std.typetuple: staticMap; import std.traits: CommonType, OriginalType; alias CommonOriginalType(T...) = CommonType!(staticMap!(OriginalType, T)); /per
May 02 2014
On 02/05/14 20:03, Joseph Rushton Wakeling via Digitalmars-d-learn wrote:On 02/05/14 19:24, "Nordlöw" via Digitalmars-d-learn wrote:... missing a closing bracket there :-PDo I have to use recursion (like in CommonType) to implement this or is there a better way?Won't it work to use, is(CommonType!(OriginalType!T1, OriginalType!T2)
May 02 2014