You could try:
        boost::polygon::assign(p3, p1&p2);

Or, if you're using namespace boost::polygon::operators, you could write:
        p3 = p1;
        p3 &= p2;

2011/10/17 Dimitris Dakopoulos <dakopoulos@gmail.com>
Hello all,
I'm using a custom polygon set (PolygonCollection) according to the guidelines here: http://www.boost.org/doc/libs/1_47_0/libs/polygon/doc/gtl_custom_polygon_set.htm
There is one case  that I don't get any compiler error:

PolygonCollection p1, p2;
p1 & p2;

There is this case that I do have an error:

PolygonCollection p1, p2;
PolygonCollection p3 = p1 & p2;

The error is: error: conversion from 'boost::polygon::polygon_set_view<PolygonCollection, PolygonCollection, 1>' to non-scalar type 'PolygonCollection' requested

There is also this case that I have a compiler error:

PolygonCollection p1,p2,p3;
p3 = p1 & p2; 

The error is:error: no match for 'operator=' in 'p3 = boost::polygon::operators::operator&(const geometry_type_1&, const geometry_type_2&) [with geometry_type_1 = PolygonCollection, geometry_type_2 = PolygonCollection](((const PolygonCollection&)((const PolygonCollection*)(& p1))))'
/xxx/Polygon.hpp:182: note: candidates are: PolygonCollection& PolygonCollection::operator=(const PolygonCollection&)

(You can notice that I have overloaded the operator= for my custom polygon set but I got the same error without the suggestion before my implementation)

Any ideas are welcomed!

Dimitris

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users