Chris@102: // Boost.Geometry (aka GGL, Generic Geometry Library) Chris@102: Chris@102: // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. Chris@102: // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. Chris@102: // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. Chris@102: Chris@102: // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library Chris@102: // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. Chris@102: Chris@102: // Use, modification and distribution is subject to the Boost Software License, Chris@102: // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@102: // http://www.boost.org/LICENSE_1_0.txt) Chris@102: Chris@102: #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_MULTI_SUM_HPP Chris@102: #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_MULTI_SUM_HPP Chris@102: Chris@102: #include Chris@102: Chris@102: Chris@102: namespace boost { namespace geometry Chris@102: { Chris@102: #ifndef DOXYGEN_NO_DETAIL Chris@102: namespace detail Chris@102: { Chris@102: Chris@102: struct multi_sum Chris@102: { Chris@102: template Chris@102: static inline ReturnType apply(MultiGeometry const& geometry, Strategy const& strategy) Chris@102: { Chris@102: ReturnType sum = ReturnType(); Chris@102: for (typename boost::range_iterator Chris@102: < Chris@102: MultiGeometry const Chris@102: >::type it = boost::begin(geometry); Chris@102: it != boost::end(geometry); Chris@102: ++it) Chris@102: { Chris@102: sum += Policy::apply(*it, strategy); Chris@102: } Chris@102: return sum; Chris@102: } Chris@102: }; Chris@102: Chris@102: Chris@102: } // namespace detail Chris@102: #endif Chris@102: Chris@102: }} // namespace boost::geometry Chris@102: Chris@102: Chris@102: #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_MULTI_SUM_HPP