...one of the most highly
regarded and expertly designed C++ library projects in the
world.

— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards

This is the documentation for a snapshot of the develop branch, built from commit 7a526fa2b7.

Metafunction defining **value** as the closure
(clockwise, counterclockwise) of the specified geometry type.

template<typename Geometry> struct closure : public std::integral_constant< closure_selector, core_dispatch::closure< tag_t< Geometry >, util::remove_cptrref_t< Geometry > >::value > { // ... };

Parameter |
Description |
---|---|

typename Geometry |
Any type fulfilling a Geometry Concept |

Either

`#include <boost/geometry.hpp>`

Or

`#include <boost/geometry/core/closure.hpp>`

Note | |
---|---|

The closure is defined for any geometry type, but only has a real meaning for areal geometry types (ring, polygon, multi_polygon) |

Compile time

Examine if a polygon is defined as "should be closed"

#include <iostream> #include <boost/geometry.hpp> #include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/point_xy.hpp> int main() { using point_type = boost::geometry::model::d2::point_xy<double>; using polygon_type = boost::geometry::model::polygon<point_type>; boost::geometry::closure_selector clos = boost::geometry::closure<polygon_type>::value; std::cout << "closure: " << clos << std::endl << "(open = " << boost::geometry::open << ", closed = " << boost::geometry::closed << ") "<< std::endl; return 0; }

Output:

closure: 1 (open = 0, closed = 1)