Casting between tuples

2011-01-12 Thread Sean Eskapp
I have a variable of type TypeTuple!(int, int), and I want to convert all its elements into a variable of type TypeTuple!(string, string). Is there a way to do this? Using a loop fails compilation with "Error: Integer constant expression expected instead of i". I'd also like to be able to convert

Re: Casting between tuples

2011-01-12 Thread Simen kjaeraas
Sean Eskapp wrote: I have a variable of type TypeTuple!(int, int), and I want to convert all its elements into a variable of type TypeTuple!(string, string). Is there a way to do this? Using a loop fails compilation with "Error: Integer constant expression expected instead of i". Just to

Re: Casting between tuples

2011-01-12 Thread Jesse Phillips
Sean Eskapp Wrote: > I have a variable of type TypeTuple!(int, int), and I want to convert all its > elements into a variable of type TypeTuple!(string, string). Is there a way to > do this? Using a loop fails compilation with "Error: Integer constant > expression expected instead of i". > > I'd

Re: Casting between tuples

2011-01-12 Thread Jesse Phillips
Wow, missed the part where TypeTuples can hold values. I suggest looking into using Tuple from std.typecons. What you need to remember is that you are not casting the tuple, you are casting the data in the tuple which creates a completely different tuple. It seems you are trying to use the type