Boost logo

Boost :

Subject: Re: [boost] [Polygon] What does this error mean?
From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2009-09-01 16:38:41


Dear Luke (& others),

Here's some test code, followed by the errors that I get when I try to
compile it. It boils down to some confusion about whether set is a
type or a function. Am I doing something that isn't allowed? Thanks
for any suggestions.

#include <boost/polygon/polygon.hpp>

template<typename COORD_T>
struct Box {
   typedef COORD_T coord_t;
   coord_t x0;
   coord_t y0;
   coord_t x1;
   coord_t y1;
};

typedef int screen_coord_t;
typedef Box<screen_coord_t> screen_box_t;

namespace boost { namespace polygon {

template <>
struct geometry_concept<screen_box_t> {
   typedef rectangle_concept type;
};

template <>
struct rectangle_traits<screen_box_t> {
   typedef screen_coord_t coordinate_type;
   typedef std::pair<screen_coord_t,screen_coord_t> interval_type;
   static inline interval_type get(const screen_box_t& rectangle,
orientation_2d orient) {
     return (orient==HORIZONTAL) ? std::make_pair(rectangle.x0,rectangle.x1)
                                 : std::make_pair(rectangle.y0,rectangle.y1);
   }
};

}; };

typedef boost::polygon::polygon_90_set_data<screen_coord_t> markers_t;
markers_t markers;

void draw_marker(screen_box_t sb)
{
   using namespace boost::polygon::operators;
   markers |= sb;
}

/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/stl_set.h:
In function ‘typename boost::enable_if<typename
boost::polygon::gtl_and_3<boost::polygon::y_r_assign, typename
boost::polygon::is_mutable_rectangle_concept<typename
boost::polygon::geometry_concept<T>::type>::type, typename
boost::polygon::is_rectangle_concept<typename
boost::polygon::geometry_concept<T2>::type>::type>::type,
rectangle_type_1>::type& boost::polygon::assign(rectangle_type_1&,
const rectangle_type_2&) [with rectangle_type_1 =
boost::polygon::rectangle_data<int>, rectangle_type_2 = Box<int>]’:
/usr/local/src/gtl/boost/polygon/detail/iterator_geometry_to_set.hpp:34:
instantiated from
‘boost::polygon::iterator_geometry_to_set<boost::polygon::rectangle_concept,
rectangle_type>::iterator_geometry_to_set(const rectangle_type&,
boost::polygon::direction_1d, boost::polygon::orientation_2d, bool)
[with rectangle_type = Box<int>]’
/usr/local/src/gtl/boost/polygon/polygon_90_set_data.hpp:137:
instantiated from ‘void
boost::polygon::polygon_90_set_data<T>::insert(const geometry_type&,
bool, boost::polygon::orientation_2d) [with geometry_type = Box<int>, T
= int]’
/usr/local/src/gtl/boost/polygon/polygon_90_set_data.hpp:113:
instantiated from ‘void
boost::polygon::polygon_90_set_data<T>::insert(iT, iT,
boost::polygon::orientation_2d) [with iT = const Box<int>*, T = int]’
/usr/local/src/gtl/boost/polygon/detail/polygon_90_set_view.hpp:318:
instantiated from ‘typename boost::enable_if<typename
boost::polygon::gtl_and<boost::polygon::operators::y_ps90_pe, typename
boost::polygon::is_polygon_90_set_type<polygon_set_type_2>::type>::type,
boost::polygon::polygon_90_set_data<coordinate_type> >::type&
boost::polygon::operators::operator+=(boost::polygon::polygon_90_set_data<coordinate_type>&,
const geometry_type_2&) [with coordinate_type_1 = int, geometry_type_2
= Box<int>]’
/usr/local/src/gtl/boost/polygon/detail/polygon_90_set_view.hpp:329:
instantiated from ‘typename boost::enable_if<typename
boost::polygon::gtl_and<boost::polygon::operators::y_ps90_be, typename
boost::polygon::is_polygon_90_set_type<polygon_set_type_2>::type>::type,
boost::polygon::polygon_90_set_data<coordinate_type> >::type&
boost::polygon::operators::operator|=(boost::polygon::polygon_90_set_data<coordinate_type>&,
const geometry_type_2&) [with coordinate_type_1 = int, geometry_type_2
= screen_box_t]’
testpoly.cc:41: instantiated from here
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/stl_set.h:71:
error: ‘template<class _Key, class _Compare, class _Alloc> class
std::set’ is not a function,
/usr/local/src/gtl/boost/polygon/point_concept.hpp:77: error:
conflict with ‘template<class T, class coordinate_type> void
boost::polygon::set(T&, boost::polygon::orientation_2d,
coordinate_type, typename boost::enable_if<typename
boost::polygon::is_mutable_point_concept<typename
boost::polygon::geometry_concept<T>::type>::type, void>::type*)’
/usr/local/src/gtl/boost/polygon/rectangle_concept.hpp:192: error: in
call to ‘set’
/usr/local/src/gtl/boost/polygon/detail/iterator_geometry_to_set.hpp:34:
instantiated from
‘boost::polygon::iterator_geometry_to_set<boost::polygon::rectangle_concept,
rectangle_type>::iterator_geometry_to_set(const rectangle_type&,
boost::polygon::direction_1d, boost::polygon::orientation_2d, bool)
[with rectangle_type = Box<int>]’
/usr/local/src/gtl/boost/polygon/polygon_90_set_data.hpp:137:
instantiated from ‘void
boost::polygon::polygon_90_set_data<T>::insert(const geometry_type&,
bool, boost::polygon::orientation_2d) [with geometry_type = Box<int>, T
= int]’
/usr/local/src/gtl/boost/polygon/polygon_90_set_data.hpp:113:
instantiated from ‘void
boost::polygon::polygon_90_set_data<T>::insert(iT, iT,
boost::polygon::orientation_2d) [with iT = const Box<int>*, T = int]’
/usr/local/src/gtl/boost/polygon/detail/polygon_90_set_view.hpp:318:
instantiated from ‘typename boost::enable_if<typename
boost::polygon::gtl_and<boost::polygon::operators::y_ps90_pe, typename
boost::polygon::is_polygon_90_set_type<polygon_set_type_2>::type>::type,
boost::polygon::polygon_90_set_data<coordinate_type> >::type&
boost::polygon::operators::operator+=(boost::polygon::polygon_90_set_data<coordinate_type>&,
const geometry_type_2&) [with coordinate_type_1 = int, geometry_type_2
= Box<int>]’
/usr/local/src/gtl/boost/polygon/detail/polygon_90_set_view.hpp:329:
instantiated from ‘typename boost::enable_if<typename
boost::polygon::gtl_and<boost::polygon::operators::y_ps90_be, typename
boost::polygon::is_polygon_90_set_type<polygon_set_type_2>::type>::type,
boost::polygon::polygon_90_set_data<coordinate_type> >::type&
boost::polygon::operators::operator|=(boost::polygon::polygon_90_set_data<coordinate_type>&,
const geometry_type_2&) [with coordinate_type_1 = int, geometry_type_2
= screen_box_t]’
testpoly.cc:41: instantiated from here
/usr/local/src/gtl/boost/polygon/rectangle_concept.hpp:192: error: no
matching function for call to
‘set(boost::polygon::rectangle_data<int>&,
boost::polygon::orientation_2d_enum, std::pair<int, int>)’
/usr/local/src/gtl/boost/polygon/detail/iterator_geometry_to_set.hpp:34:
instantiated from
‘boost::polygon::iterator_geometry_to_set<boost::polygon::rectangle_concept,
rectangle_type>::iterator_geometry_to_set(const rectangle_type&,
boost::polygon::direction_1d, boost::polygon::orientation_2d, bool)
[with rectangle_type = Box<int>]’
/usr/local/src/gtl/boost/polygon/polygon_90_set_data.hpp:137:
instantiated from ‘void
boost::polygon::polygon_90_set_data<T>::insert(const geometry_type&,
bool, boost::polygon::orientation_2d) [with geometry_type = Box<int>, T
= int]’
/usr/local/src/gtl/boost/polygon/polygon_90_set_data.hpp:113:
instantiated from ‘void
boost::polygon::polygon_90_set_data<T>::insert(iT, iT,
boost::polygon::orientation_2d) [with iT = const Box<int>*, T = int]’
/usr/local/src/gtl/boost/polygon/detail/polygon_90_set_view.hpp:318:
instantiated from ‘typename boost::enable_if<typename
boost::polygon::gtl_and<boost::polygon::operators::y_ps90_pe, typename
boost::polygon::is_polygon_90_set_type<polygon_set_type_2>::type>::type,
boost::polygon::polygon_90_set_data<coordinate_type> >::type&
boost::polygon::operators::operator+=(boost::polygon::polygon_90_set_data<coordinate_type>&,
const geometry_type_2&) [with coordinate_type_1 = int, geometry_type_2
= Box<int>]’
/usr/local/src/gtl/boost/polygon/detail/polygon_90_set_view.hpp:329:
instantiated from ‘typename boost::enable_if<typename
boost::polygon::gtl_and<boost::polygon::operators::y_ps90_be, typename
boost::polygon::is_polygon_90_set_type<polygon_set_type_2>::type>::type,
boost::polygon::polygon_90_set_data<coordinate_type> >::type&
boost::polygon::operators::operator|=(boost::polygon::polygon_90_set_data<coordinate_type>&,
const geometry_type_2&) [with coordinate_type_1 = int, geometry_type_2
= screen_box_t]’
testpoly.cc:41: instantiated from here
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/stl_set.h:71:
error: ‘template<class _Key, class _Compare, class _Alloc> class
std::set’ is not a function,
/usr/local/src/gtl/boost/polygon/point_concept.hpp:77: error:
conflict with ‘template<class T, class coordinate_type> void
boost::polygon::set(T&, boost::polygon::orientation_2d,
coordinate_type, typename boost::enable_if<typename
boost::polygon::is_mutable_point_concept<typename
boost::polygon::geometry_concept<T>::type>::type, void>::type*)’
/usr/local/src/gtl/boost/polygon/rectangle_concept.hpp:193: error: in
call to ‘set’
/usr/local/src/gtl/boost/polygon/rectangle_concept.hpp:193: error: no
matching function for call to
‘set(boost::polygon::rectangle_data<int>&,
boost::polygon::orientation_2d_enum, std::pair<int, int>)’


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk