inner_range_type.hpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2014, Oracle and/or its affiliates.
  3. // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
  4. // Licensed under the Boost Software License version 1.0.
  5. // http://www.boost.org/users/license.html
  6. #ifndef BOOST_GEOMETRY_ITERATORS_DETAIL_POINT_ITERATOR_INNER_RANGE_TYPE_HPP
  7. #define BOOST_GEOMETRY_ITERATORS_DETAIL_POINT_ITERATOR_INNER_RANGE_TYPE_HPP
  8. #include <boost/range.hpp>
  9. #include <boost/type_traits/is_const.hpp>
  10. #include <boost/mpl/if.hpp>
  11. #include <boost/geometry/core/ring_type.hpp>
  12. #include <boost/geometry/core/tag.hpp>
  13. #include <boost/geometry/core/tags.hpp>
  14. namespace boost { namespace geometry
  15. {
  16. #ifndef DOXYGEN_NO_DETAIL
  17. namespace detail { namespace point_iterator
  18. {
  19. template
  20. <
  21. typename Geometry,
  22. typename Tag = typename tag<Geometry>::type
  23. >
  24. struct inner_range_type
  25. {
  26. typedef typename boost::mpl::if_c
  27. <
  28. !boost::is_const<Geometry>::type::value,
  29. typename boost::range_value<Geometry>::type,
  30. typename boost::range_value<Geometry>::type const
  31. >::type type;
  32. };
  33. template <typename Polygon>
  34. struct inner_range_type<Polygon, polygon_tag>
  35. {
  36. typedef typename boost::mpl::if_c
  37. <
  38. !boost::is_const<Polygon>::type::value,
  39. typename geometry::ring_type<Polygon>::type,
  40. typename geometry::ring_type<Polygon>::type const
  41. >::type type;
  42. };
  43. }} // namespace detail::point_iterator
  44. #endif // DOXYGEN_NO_DETAIL
  45. }} // namespace boost::geometry
  46. #endif // BOOST_GEOMETRY_ITERATORS_DETAIL_POINT_ITERATOR_INNER_RANGE_TYPE_HPP