![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
ring_typeBoost , Chapter 1. Geometry , Core Metafunctions
|
Параметр |
Описание |
---|---|
Или
#include <boost/geometry.hpp>
Или
#include <boost/geometry/core/ring_type.hpp>
Время компиляции
Показывает, как использовать метафункцию ring_type, а также Interior_type
#include <iostream> #include <typeinfo> #include <boost/geometry.hpp> #include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/point_xy.hpp> int main() { typedef boost::geometry::model::d2::point_xy<double> point; typedef boost::geometry::model::polygon<point> polygon; typedef boost::geometry::ring_type<polygon>::type ring_type; typedef boost::geometry::interior_type<polygon>::type int_type; std::cout << typeid(ring_type).name() << std::endl; std::cout << typeid(int_type).name() << std::endl; // So int_type defines a collection of rings, // which is a Boost.Range compatible range // The type of an element of the collection is the very same ring type again. // We show that. typedef boost::range_value<int_type>::type int_ring_type; std::cout << std::boolalpha << boost::is_same<ring_type, int_ring_type>::value << std::endl; return 0; }
Результат (с использованием gcc):
N5boost8geometry5model4ringINS1_2d28point_xyIdNS0_2cs9cartesianEEELb1ELb1ESt6vectorSaEE St6vectorIN5boost8geometry5model4ringINS2_2d28point_xyIdNS1_2cs9cartesianEEELb1ELb1ES_SaEESaIS9_EE true
Статья ring_type раздела Chapter 1. Geometry Core Metafunctions может быть полезна для разработчиков на c++ и boost.
Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.
:: Главная :: Core Metafunctions ::
реклама |