Runtime heterogeneous collections?

Kagamin spam at here.lot
Fri Jan 18 15:38:19 UTC 2019


On Thursday, 17 January 2019 at 02:21:21 UTC, Steven O wrote:
> void main()
> {
>     alias Rec_type = Tuple!(int, "x", int, "y", int, "z");
>     RedBlackTree!Rec_type[1] test;
> }

alias Rec_type1 = Tuple!(int, "x", int, "y", int, "z");
alias Rec_type2 = Tuple!(int, "x", int, "y", string, "z");
Tuple!(RedBlackTree!Rec_type1, "x", RedBlackTree!Rec_type2, "z") 
test;

Similar questions were asked before, usually such heterogeneous 
collections are not the best solution to the problem at hand.


More information about the Digitalmars-d-learn mailing list