
ok, what about this ? class vector3d_test { public: float x, y, z; float operator[]( int index ) const { return array[index]; } float & operator[]( int index ) { return array[index]; } union { struct { float x; float y; float z; } coord; float array[3]; }; }; but it means you have to call v.coord.x and v[0]. Olivier. On 9/21/06, me22 <me22.ca@gmail.com> wrote:
On 9/21/06, Olivier Grant <olivier.grant@gmail.com> wrote:
in which case "v.x" and "v[0]" are the same thing. this is what I currently have. Now some people will argument its a hack maybe.
Sure looks like illegal type punning to me... _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost