From: <l3...@us...> - 2007-09-24 12:48:20
|
Revision: 110 http://vmmlib.svn.sourceforge.net/vmmlib/?rev=110&view=rev Author: l3m Date: 2007-09-24 05:48:22 -0700 (Mon, 24 Sep 2007) Log Message: ----------- added iterator & const_iterator typedefs to the vector classes, and const and non-const begin() and end() functions, to allow 'type-independent' iteration over components: contrived example: :) template< typename float_t, template< typename float_t > class vec > float_t get_sum_of_components( const vec< float_t >& vector_ ) { float_t sum( 0 ); vec< float_t >::const_iterator it = vector_.begin(); vec< float_t >::const_iterator it_end = vector_.end(); for ( ; it != it_end; ++it ) { sum += *it; } return sum; } Modified Paths: -------------- trunk/include/vmmlib/vector2.h trunk/include/vmmlib/vector3.h trunk/include/vmmlib/vector4.h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |