Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10920: Boost error from XlC11. 01 using BOOST 1.53 in union
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-03-23 17:58:03
#10920: Boost error from XlC11. 01 using BOOST 1.53 in union
-------------------------------+------------------------------
Reporter: devika.rs@⦠| Owner: barendgehrels
Type: Bugs | Status: new
Milestone: To Be Determined | Component: geometry
Version: Boost 1.53.0 | Severity: Problem
Resolution: | Keywords: Union on XlC11.1
-------------------------------+------------------------------
Comment (by awulkiew):
I'm guessing that at this point we shouldn't change the definition of a
`model::ring<>` and `model::polygon<>`. So we are unable to fix it on our
side.
But those types (`model::ring`, `model::polygon`) are just the default
ones implemented for the users convenience. Boost.Geometry allows to use
any user-defined type as long as it's adapted to one of the Geometry
concepts. See:
-
http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/concepts.html
and in particular:
-
http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/concepts/concept_ring.html
-
http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/concepts/concept_polygon.html
You could implement your own ring and polygon types, adapt them to
Boost.Geometry concepts and use with the algorithms. Consider one of the
methods below:
USE MACRO FOR ADAPTATION
You could use one of the `REGISTER_XXX` macros which generates the
adaptation code automatically, see:
-
http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/adapted/register.html
and in particular:
-
http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/adapted/register/boost_geometry_register_ring.html
-
http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/adapted/register/boost_geometry_register_ring_templated.html
It could look as simple as this:
{{{
typedef boost::geometry::model::d2::point_xy<double> point_2d;
struct ring_2d : public std::vector<point_2d> {}
BOOST_GEOMETRY_REGISTER_RING(ring_2d)
}}}
ADAPT YOUR OWN TYPE MANUALLY
The most simple way of doing it would be to copy the contents of
Boost.Geometry files defining the models, e.g. see:
-
https://github.com/boostorg/geometry/blob/master/include/boost/geometry/geometries/ring.hpp
-
https://github.com/boostorg/geometry/blob/master/include/boost/geometry/geometries/polygon.hpp
Then remove unneeded template parameters (e.g. `Container` for `ring` and
`PointList`,`RingList` for `polygon`) and internally use e.g.
`std::vector<>` everywhere instead. Then adapt this type properly, so
remove the template parameters also from traits' specializations below,
etc.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10920#comment:4> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC