I have two structs:
is it possible to write a [] and = operator for IntermediateFace so that I can do this:Code:struct FaceVertex { float u; float v; int vertex; }; struct IntermediateFace { int *vertices; float *u; float *v; int numVertices; FaceVertex& operator[] (int index); IntermediateFace& operator=(FaceVertex vertex); };
IntermediateFace face;
FaceVertex vertex;
//set values here
face[0] = vertex;
where [] accesses the ith element of the three pointer elements in IntermediateFace and = sets the pointer elements to the elements of FaceVertex?