Re: Tuples and compile-time assigned properties

2013-09-19 Thread Artur Skawina
On 09/19/13 17:22, Joseph Rushton Wakeling wrote: > On 19/09/13 16:55, Artur Skawina wrote: >> I'm not sure i understand your problem, but you could use structs. ie: >> >> struct VertexProperties { >>size_t color; >>string name; >> } >> >> You can get the field names and typ

Re: Tuples and compile-time assigned properties

2013-09-19 Thread Artur Skawina
On 09/19/13 16:40, Joseph Rushton Wakeling wrote: > alias EdgeProperties = Tuple!(double, "weight"); > > alias VertexProperties = Tuple!(size_t, "colour", string, "name"); > > So then, you'd be able to extract the list of variable names and types at > compile time and use them to create

Re: Tuples and compile-time assigned properties

2013-09-19 Thread Joseph Rushton Wakeling
On 19/09/13 16:55, Artur Skawina wrote: I'm not sure i understand your problem, but you could use structs. ie: struct VertexProperties { size_t color; string name; } You can get the field names and types at CT and work with that. Yes, that's a good suggestion. I guess I

Re: Tuples and compile-time assigned properties

2013-09-19 Thread Dicebot
On Thursday, 19 September 2013 at 14:56:08 UTC, Artur Skawina wrote: I'm not sure i understand your problem, but you could use structs. ie: struct VertexProperties { size_t color; string name; } You can get the field names and types at CT and work with that. +1 Why do you n

Re: Tuples and compile-time assigned properties

2013-09-19 Thread Joseph Rushton Wakeling
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 co