// Boost.Geometry // Copyright (c) 2022, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html #ifndef BOOST_GEOMETRY_VIEWS_GEOMETRY_COLLECTION_VIEW_HPP #define BOOST_GEOMETRY_VIEWS_GEOMETRY_COLLECTION_VIEW_HPP #include #include #include #include #include #include namespace boost { namespace geometry { namespace detail { template class geometry_collection_view { public: using iterator = Geometry const*; using const_iterator = Geometry const*; explicit geometry_collection_view(Geometry const& geometry) : m_geometry(geometry) {} const_iterator begin() const { return boost::addressof(m_geometry); } const_iterator end() const { return boost::addressof(m_geometry) + 1; } private: Geometry const& m_geometry; }; } // namespace detail #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS namespace traits { template struct tag> { using type = geometry_collection_tag; }; template struct geometry_types> { using type = util::type_sequence; }; template struct iter_visit> { template static void apply(Function && function, Iterator iterator) { function(*iterator); } }; } // namespace traits #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS }} // namespace boost::geometry #endif // BOOST_GEOMETRY_VIEWS_GEOMETRY_COLLECTION_VIEW_HPP