set is not member of boost::PolygonSet

I am trying to overload & operator for PolygonSet but end with following error. I can understand boost::PolygonSet does not have set function but can anyone provide me input to fix this issue. I have tried view_as but did not success.

The code:

  Function definition for concept    
    namespace boost { namespace polygon {
         template <>
         struct geometry_concept<boost_geom_api::PolygonSet> {
             typedef polygon_set_concept type;
         }; } }

         PolygonSet PolygonSet::operator&(const PolygonSet& right) const {
             using namespace boost::polygon::operators;
             PolygonSet ps (*this);
             ps &= right;
             return ps;
         }

 PolygonSet& PolygonSet::operator&=(const PolygonSet& right) {
     using namespace boost::polygon::operators;
     using namespace gtl;
     pgns &= right.pgns;
     return (*this); }

Error :

/polygon_set.cpp:160:19:   required from here
/u/logic/depot/boost_1_57_0/include/boost/polygon/interval_concept.hpp:168:10:

error: no type named 'type' in 'struct boost::enable_if, boost::polygon::point_data >'

Message during compilation

/u/logic/depot/boost_1_57_0/include/boost/polygon/detail/polygon_set_view.hpp:198:5: required from 'geometry_type_1& boost::polygon::self_assignment_boolean_op(geometry_type_1&, const geometry_type_2&) [with geometry_type_1 = std::vector; geometry_type_2 = boost_geom_api::PolygonSet; int op_type = 1]' /u/logic/depot/boost_1_57_0/include/boost/polygon/polygon_set_concept.hpp:419:90: required from 'typename boost::enable_if::type, typename boost::polygon::is_any_polygon_set_type::type>::type, geometry_type_1>::type& boost::polygon::operators::operator&=(geometry_type_1&, const geometry_type_2&) [with geometry_type_1 = std::vector; geometry_type_2 = boost_geom_api::PolygonSet; typename boost::enable_if

boost::polygon::is_mutable_polygon_set_type::type, typename boost::polygon::is_any_polygon_set_type::type>::type, geometry_type_1>::type = std::vector]' /polygon_set.cpp:160:13: required from here /u/logic/depot/boost_1_57_0/include/boost/polygon/polygon_90_set_traits.hpp:57:51: error: no type named 'coordinate_type' in 'boost::polygon::get_coordinate_type::traits_type {aka struct boost::polygon::polygon_set_traits}'

required from 'typename boost::enable_if::type, typename boost::polygon::is_any_polygon_set_type::type>::type, geometry_type_1>::type& boost::polygon::operators::operator&=(geometry_type_1&, const geometry_type_2&) [with geometry_type_1 = std::vector; geometry_type_2 = std::vector; typename boost::enable_if::type, typename boost::polygon::is_any_polygon_set_type::type>::type, geometry_type_1>::type = std::vector]'

链接地址: http://www.djcxy.com/p/29760.html

上一篇: 如何将std :: string转换为const char *或char *?

下一篇: set不是boost :: PolygonSet的成员