Chris@102: // Boost.Geometry (aka GGL, Generic Geometry Library) Chris@102: Chris@102: // Copyright (c) 2014, Oracle and/or its affiliates. Chris@102: Chris@102: // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle Chris@102: Chris@102: // Licensed under the Boost Software License version 1.0. Chris@102: // http://www.boost.org/users/license.html Chris@102: Chris@102: #ifndef BOOST_GEOMETRY_ITERATORS_HAS_ONE_ELEMENT_HPP Chris@102: #define BOOST_GEOMETRY_ITERATORS_HAS_ONE_ELEMENT_HPP Chris@102: Chris@102: Chris@102: namespace boost { namespace geometry Chris@102: { Chris@102: Chris@102: Chris@102: // free function to test if an iterator range has a single element Chris@102: template Chris@102: inline bool has_one_element(Iterator first, Iterator beyond) Chris@102: { Chris@102: return first != beyond && ++first == beyond; Chris@102: } Chris@102: Chris@102: Chris@102: }} // namespace boost::geometry Chris@102: Chris@102: Chris@102: #endif // BOOST_GEOMETRY_ITERATORS_HAS_ONE_ELEMENT_HPP