Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:51:44

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
0004 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
0005 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
0006 
0007 // This file was modified by Oracle on 2020-2021.
0008 // Modifications copyright (c) 2020-2021 Oracle and/or its affiliates.
0009 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0010 
0011 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0012 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0013 
0014 // Use, modification and distribution is subject to the Boost Software License,
0015 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0016 // http://www.boost.org/LICENSE_1_0.txt)
0017 
0018 #ifndef BOOST_GEOMETRY_VIEWS_IDENTITY_VIEW_HPP
0019 #define BOOST_GEOMETRY_VIEWS_IDENTITY_VIEW_HPP
0020 
0021 #include <boost/range/iterator_range.hpp>
0022 
0023 #include <boost/range/begin.hpp>
0024 #include <boost/range/end.hpp>
0025 
0026 
0027 namespace boost { namespace geometry
0028 {
0029 
0030 // Silence warning C4512: assignment operator could not be generated
0031 #if defined(_MSC_VER)
0032 #pragma warning(push)
0033 #pragma warning(disable : 4512)
0034 #endif
0035 
0036 /*!
0037 \brief View on a range, not modifying anything
0038 \tparam Range original range
0039 \ingroup views
0040 */
0041 template <typename Range>
0042 struct identity_view
0043 {
0044     using const_iterator = typename boost::range_iterator<Range const>::type;
0045     using iterator = typename boost::range_iterator<Range>::type;
0046 
0047     explicit inline identity_view(Range& r)
0048         : m_begin(boost::begin(r))
0049         , m_end(boost::end(r))
0050     {}
0051 
0052     inline const_iterator begin() const { return m_begin; }
0053     inline const_iterator end() const { return m_end; }
0054 
0055     inline iterator begin() { return m_begin; }
0056     inline iterator end() { return m_end; }
0057 
0058 private:
0059     iterator m_begin;
0060     iterator m_end;
0061 };
0062 
0063 #if defined(_MSC_VER)
0064 #pragma warning(pop)
0065 #endif
0066 
0067 }} // namespace boost::geometry
0068 
0069 
0070 #endif // BOOST_GEOMETRY_VIEWS_IDENTITY_VIEW_HPP