<div dir="ltr"><div>A)</div>how do I get the ith field of a std.typecons.Tuple ?<div>ideally, it should be as simple as:</div><div><br></div><div>auto t=Tuple!(int,"name",double,"name2")(1);</div><div>static assert(t.fields[0] == "name");</div>
<div><div><br></div><div>It seems the necessary items are private, so how do I get the ith field of a std.typecons.Tuple ?<div>I really don't want to parse T.stringof, which could require a full parser </div><div>(eg: with Tuple!(A!"bar","name") )</div>
<div><br></div><div>B) </div><div>Related question:</div></div></div><div>Why isn't slicing and indexing allowed for the Tuple type?</div><div>eg:</div><div>alias T=typeof(t);</div><div><div>static assert(is(T[0] == int));</div>
</div><div><div>static assert(is(T[0..1] == Tuple!(int,"name"));</div></div><div><br></div><div>C)</div><div>Same with appending:</div><div><div>static assert(is(T[0..1]~T[1..2] == T));</div><div><br></div><div>
D)</div><div>I'm trying to make an append operator but because of problem (A) above I can't (for named Tuples).</div><div><br></div><div><br></div><div></div></div></div>