Quote:
That won't work for the exact reason why I needed the macro.
What?
You won't need the macro at all. The compiler will give you the default copy/assign which are are quite enough. In fact implementing them at all (using the macro in this case) is really bad idea i suspect*
class vecy : public tuple<int,2>{public // Don't need this // CSE_TUPLE_ASSIGN_MACRO(vecy,int,2) // dont need this either // vecy() {}};
*
Your class would not be a aggregate if you implemnt any of the ctors and that would prevent you from doing nice array-like initializations like so
tuple<int,4> quad = { 2, 3, 4, 5 }; // error
I for one would really like that syntax for these small array-types.
Remove these lines from your tuple class and that array init will work.
tuple() {} and protected:
tuple<int,4> quad = { 2, 3, 4, 5 }; // fine
Yah, inheriting from boost.array would make it a non-aggregate aswell however it already was so i wansnt doing any more damage :)
you can however make boost.array a member var and just delegate to it. However that doesnt save you much work at all.
But for the love of god add standard iterator support to your tuple class.