multi_modify_with_predicate.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
  3. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
  4. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
  5. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
  6. // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
  7. // Use, modification and distribution is subject to the Boost Software License,
  8. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  9. // http://www.boost.org/LICENSE_1_0.txt)
  10. #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_MULTI_MODIFY_WITH_PREDICATE_HPP
  11. #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_MULTI_MODIFY_WITH_PREDICATE_HPP
  12. #include <boost/range.hpp>
  13. namespace boost { namespace geometry
  14. {
  15. #ifndef DOXYGEN_NO_DETAIL
  16. namespace detail
  17. {
  18. template <typename MultiGeometry, typename Predicate, typename Policy>
  19. struct multi_modify_with_predicate
  20. {
  21. static inline void apply(MultiGeometry& multi, Predicate const& predicate)
  22. {
  23. typedef typename boost::range_iterator<MultiGeometry>::type iterator_type;
  24. for (iterator_type it = boost::begin(multi);
  25. it != boost::end(multi);
  26. ++it)
  27. {
  28. Policy::apply(*it, predicate);
  29. }
  30. }
  31. };
  32. } // namespace detail
  33. #endif
  34. }} // namespace boost::geometry
  35. #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_MULTI_MODIFY_WITH_PREDICATE_HPP