
2010/2/8 Agustín K-ballo Bergé <kaballo86@hotmail.com>:
boost::la::la_detail::vref_< T > get( int index ) { return boost::la::vref( ... ); }
I was actually interested in the ... part :) Why isn't it plausible for you to do: my_own_conforming_vector_type get( int index ) { ... } For example: struct vertex { float pos[3]; float normal[3]; }; float (&get_pos(int index))[3] { return verts[index].pos; }
In my current project I use the library to generically work with any conforming vertex type, so I can't use the subscript operator since it would be optional. That's why I propose adding support for subscript operator via vref/mref. vref/mref would wrap the UDTs and implement the subscript operators, similar to what they currently do for arrays.
However, all this presumes that op| doesn't work well. The only potential issue with it is the low precedence. Is that why you'd rather use op[ ]? Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode