3 // Copyright (c) 2014-2021, Oracle and/or its affiliates.
4 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
5 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
7 // Licensed under the Boost Software License version 1.0.
8 // http://www.boost.org/users/license.html
10 #ifndef BOOST_GEOMETRY_ITERATORS_DETAIL_HAS_ONE_ELEMENT_HPP
11 #define BOOST_GEOMETRY_ITERATORS_DETAIL_HAS_ONE_ELEMENT_HPP
14 namespace boost { namespace geometry { namespace detail
18 // free function to test if an iterator range has a single element
19 template <typename Iterator>
20 inline bool has_one_element(Iterator first, Iterator last)
22 return first != last && ++first == last;
26 }}} // namespace boost::geometry::detail
29 #endif // BOOST_GEOMETRY_ITERATORS_DETAIL_HAS_ONE_ELEMENT_HPP