12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #ifndef BOOST_GEOMETRY_VIEWS_IDENTITY_VIEW_HPP
- #define BOOST_GEOMETRY_VIEWS_IDENTITY_VIEW_HPP
- #include <boost/range/iterator_range.hpp>
- #include <boost/range/begin.hpp>
- #include <boost/range/end.hpp>
- namespace boost { namespace geometry
- {
- #if defined(_MSC_VER)
- #pragma warning(push)
- #pragma warning(disable : 4512)
- #endif
- template <typename Range>
- struct identity_view
- {
- using const_iterator = typename boost::range_iterator<Range const>::type;
- using iterator = typename boost::range_iterator<Range>::type;
- explicit inline identity_view(Range& r)
- : m_begin(boost::begin(r))
- , m_end(boost::end(r))
- {}
- inline const_iterator begin() const { return m_begin; }
- inline const_iterator end() const { return m_end; }
- inline iterator begin() { return m_begin; }
- inline iterator end() { return m_end; }
- private:
- iterator m_begin;
- iterator m_end;
- };
- #if defined(_MSC_VER)
- #pragma warning(pop)
- #endif
- }}
- #endif
|