]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/doc/src/examples/core/tag_cast.cpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / geometry / doc / src / examples / core / tag_cast.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 // QuickBook Example
3
4 // Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
5
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)
9
10 //[tag_cast
11 //` Check if the polygon_tag can be casted to the areal_tag
12
13 #include <iostream>
14 #include <typeinfo>
15
16 #include <boost/geometry.hpp>
17 #include <boost/geometry/geometries/polygon.hpp>
18 #include <boost/geometry/geometries/point_xy.hpp>
19
20 namespace geo = boost::geometry;
21 int main()
22 {
23 typedef geo::model::d2::point_xy<double> point_type;
24 typedef geo::model::polygon<point_type> polygon_type;
25
26 typedef geo::tag<polygon_type>::type tag;
27 typedef geo::tag_cast<tag, geo::linear_tag, geo::areal_tag>::type base_tag;
28
29 std::cout << "tag: " << typeid(tag).name() << std::endl
30 << "base tag: " << typeid(base_tag).name() << std::endl;
31
32 return 0;
33 }
34
35 //]
36
37
38 //[tag_cast_output
39 /*`
40 Output (in MSVC):
41 [pre
42 tag: struct boost::geometry::polygon_tag
43 base tag: struct boost::geometry::areal_tag
44 ]
45 */
46 //]