Tuples and compile-time assigned properties

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Thu Sep 19 08:29:19 PDT 2013


On 19/09/13 17:21, Dicebot wrote:
> +1 Why do you need to use tuples and manually force them into struct behavior
> instead of simply using structs?

I guess I was thinking it'd be more finnicky to do something like

    struct EdgeProperties { double weight; }

    struct VertexProperties { size_t colour; string name; }

    auto g = Graph!(EdgeProperties, VertexProperties);

... than to allow the user the flexibility of just knocking up a Tuple in the 
moment.  But now that I think about it, it's not actually more complicated really.


More information about the Digitalmars-d-learn mailing list