]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/doc/src/examples/core/tag_cast.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
6 // Use, modification and distribution is subject to the Boost Software License,
7 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
11 //` Check if the polygon_tag can be casted to the areal_tag
16 #include <boost/geometry.hpp>
17 #include <boost/geometry/geometries/polygon.hpp>
18 #include <boost/geometry/geometries/point_xy.hpp>
20 namespace geo
= boost::geometry
;
23 typedef geo::model::d2::point_xy
<double> point_type
;
24 typedef geo::model::polygon
<point_type
> polygon_type
;
26 typedef geo::tag
<polygon_type
>::type tag
;
27 typedef geo::tag_cast
<tag
, geo::linear_tag
, geo::areal_tag
>::type base_tag
;
29 std::cout
<< "tag: " << typeid(tag
).name() << std::endl
30 << "base tag: " << typeid(base_tag
).name() << std::endl
;
42 tag: struct boost::geometry::polygon_tag
43 base tag: struct boost::geometry::areal_tag