Boost logo

Geometry :

Subject: [geometry] ring_const_type issues
From: Steven Anker (anker_at_[hidden])
Date: 2012-03-01 09:24:45


The following program does not compile using the MinGW version of GCC
4.6.1:

 

#include <boost/geometry/geometry.hpp>

#include <boost/geometry/geometries/geometries.hpp>

#include <boost/geometry/multi/geometries/multi_polygon.hpp>

#include <boost/geometry/multi/geometries/multi_point.hpp>

 

namespace bg = boost::geometry;

 

typedef bg::model::point<double, 2, bg::cs::cartesian> point_2d;

typedef bg::model::polygon<point_2d> polygon_2d;

typedef bg::model::multi_polygon<point_2d> multi_polygon_2d;

 

void f(const polygon_2d&)

{}

 

void f(const multi_polygon_2d&)

{}

 

int main(int argc, char* argv[])

{

    f(polygon_2d());

    return 0;

}

 

This is a very long error output. I'll just put the first relevant
compile error here:

 

In file included from
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/boost/geometry
/core/point_type.hpp:22:0,

from
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/boost/geometry
/core/coordinate_system.hpp:20,

from
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/boost/geometry
/core/cs.hpp:21,

from
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/boost/geometry
/geometry.hpp:19,

from main.cpp:1:

c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/boost/geometry
/core/ring_type.hpp: In instantiation of
'boost::geometry::traits::ring_const_type<boost::geometry::model::point<
double, 2u, boost::geometry::cs::cartesian> >':

c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/boost/geometry
/geometries/concepts/polygon_concept.hpp:43:66: instantiated from
'boost::geometry::concept::Polygon<boost::geometry::model::point<double,
2u, boost::geometry::cs::cartesian> >'

c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/boost/concept/
detail/has_constraints.hpp:42:5: instantiated from 'const bool
boost::concepts::not_satisfied<boost::geometry::concept::Polygon<boost::
geometry::model::point<double, 2u, boost::geometry::cs::cartesian> >
>::value'

c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/boost/concept/
detail/has_constraints.hpp:45:31: instantiated from
'boost::concepts::not_satisfied<boost::geometry::concept::Polygon<boost:
:geometry::model::point<double, 2u, boost::geometry::cs::cartesian> > >'

c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/boost/mpl/if.h
pp:67:11: instantiated from
'boost::mpl::if_<boost::concepts::not_satisfied<boost::geometry::concept
::Polygon<boost::geometry::model::point<double, 2u,
boost::geometry::cs::cartesian> > >,
boost::concepts::constraint<boost::geometry::concept::Polygon<boost::geo
metry::model::point<double, 2u, boost::geometry::cs::cartesian> > >,
boost::concepts::requirement<boost::concepts::failed************
boost::geometry::concept::Polygon<boost::geometry::model::point<double,
2u, boost::geometry::cs::cartesian> >::************> >'

c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/boost/concept/
detail/general.hpp:50:8: instantiated from
'boost::concepts::requirement_<void
(*)(boost::geometry::concept::Polygon<boost::geometry::model::point<doub
le, 2u, boost::geometry::cs::cartesian> >)>'

c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/boost/geometry
/multi/geometries/multi_polygon.hpp:51:1: instantiated from
'boost::geometry::model::multi_polygon<boost::geometry::model::point<dou
ble, 2u, boost::geometry::cs::cartesian> >'

main.cpp:21:16: instantiated from here

c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/boost/geometry
/core/ring_type.hpp:47:5: error: no matching function for call to
'assertion_failed(mpl_::failed************
(boost::geometry::traits::ring_const_type<boost::geometry::model::point<
double, 2u, boost::geometry::cs::cartesian>
>::NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE::************)(mpl_::assert_::
types<boost::geometry::model::point<double, 2u,
boost::geometry::cs::cartesian>, mpl_::na, mpl_::na, mpl_::na>))'

c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/boost/geometry
/core/ring_type.hpp:47:5: note: candidate is:

c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/boost/mpl/asse
rt.hpp:79:48: note: template<bool C> int mpl_::assertion_failed(typename
mpl_::assert<C>::type)

 

This seems like unwanted behavior to me. (At least I do want it J ). Am
I correct?

 

Steven

 



Geometry list run by mateusz at loskot.net