1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2014, Oracle and/or its affiliates.
5 // Contributed and/or modified by Menelaos Karavelas, 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_HAS_ONE_ELEMENT_HPP
11 #define BOOST_GEOMETRY_ITERATORS_HAS_ONE_ELEMENT_HPP
14 namespace boost { namespace geometry
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 beyond)
22 return first != beyond && ++first == beyond;
26 }} // namespace boost::geometry
29 #endif // BOOST_GEOMETRY_ITERATORS_HAS_ONE_ELEMENT_HPP