Boost logo

Boost :

Subject: Re: [boost] Formal Review: Boost.Polygon
From: Fernando Cacciola (fernando.cacciola_at_[hidden])
Date: 2009-09-15 12:00:55

Hi Luke,
>> ** The polygon_data type should be mutable (i.e. support things like
>> push_back()), or a mutable version should be provided, or
>> std::vector/list<point_data> should work with minimal traits
>> specialisation.
> The example custom_polygon.cpp shows the traits for a list<CPoint>. I could
> make all containers of points models of polygons_concept by default, but I
> wouldn't know which polygon concept the user prefers.
A mere container of points should be a model of the most general polygon concept
(which is polygon_concept)

>> I also found that polygon_data is specialised by the coordinate type, not
>> the point type, so anyone using their own point type will have to provide
>> their own polygon type. Is there some reason why I can't have
>> polygon_data<my_point>? Again, making it easier to use
>> std::container<my_point> would help.
> Point type is a trait.
Can you elaborate in your response?

If I have

struct my_point { float x,y; }

How do I create a "polygon_data" that uses that point type?

AFAICT that is just not possible.

>> ** extents() and center() should return their results, rather than using an
>> output reference.
> Out parameters and equational reasoning have been discussed elsewhere in the
> review.
Yes, but I'm not sure what is your position regarding that.
Can you clarify it?


Fernando Cacciola
SciSoft Consulting, Founder

Boost list run by bdawes at, gregod at, cpdaniel at, john at