Hi, lets say i have two arbitary container of any stl type. <br><br>template<br><<br>class T,<br>template <typename ELEM, typename = std::allocator<ELEM> ><br>class CONT<br>><br>typename boost::enable_if<boost::is_floating_point<T>, T>::type <br>getManhattanDistance(const CONT<T>& ObjectX, const CONT<T>& ObjectY)<br><br>I want to be able to iterate through both containers to get the euclidean distance.. i.e. <br><br>sqrt of sum of each item in ObjectX - ObjectY square. <br><br>Psuedocode looks like this.. <br>/***********************************************<br>* getManhattanDistance(ObjectX, ObjectY) *<br>* overAllSum <-- 0 *<br>* for i <-- 0 to sizeof (ObjectX) * <br>* Xn <-- ObjectX[i] *<br>* Yn <-- ObjectY[i] *<br>* difference <-- (Xn - Yn) * -1 *<br>* overAllSum <-- overAllSum + difference *<br> ***********************************************/<br><br>but i want to make it as abstract (allowing nonindexable containers) but also clear as possible without losing speed. Whats the best way to do this using boost library. <br><br><br>