all in one!
how might i get this to compile?
template<class T>
struct point { T x, y; };
typedef list< point<?> > line;
first we create struct point, which will take ints, floats, doubles, or what have you, as long as they are the same, right..?
then we want "line" to be a list of points, so long as each point has the same type.
putting "int" in for the ? will compile, however, that's not what I want. replacing it with "T" also doesnt work. leaving the <?> out altogether doesnt work either.. so ya.. not really sure.
also, just for clarification,
struct rect
{
union { int x1, left; };
union { int x2, right; };
union { int y1, top; };
union { int y2, bottom; };
};
will let me create a rect, and i can refer to left-most vertical line of the rectangle as "x1" or "left" and they are interchangable, correct? ie, if i change 'x1', it changes 'left'?