|
Boost Users : |
Subject: Re: [Boost-users] [geometry] problems with the ring concept
From: Michael Powell (mwpowellhtx_at_[hidden])
Date: 2013-08-25 09:46:55
On Sun, Aug 25, 2013 at 8:19 AM, Lepere Renaud <lepere.renaud_at_[hidden]> wrote:
>
>
>>> My Ring structure is very simple :
>>> typedef std::vector< Point > Points;
>>> struct Ring
>>> {
>>> Points points;
>>> };
>>
>> I'm not sure you're making it more complex than it needs to be. It
>> seems like a Ring *IS* a Vector of Points. And/or the *application* of
>> that type. So why not run with the type you've already defined?
>>
>> typedef std::vector<Point> points_vector;
>> //...
>> points_vector my_ring;
>>
>> Or:
>>
>> typedefin std::vector<Point> ring_type;
>>
>> Then you don't have to implement anything else, no other iterators:
>> vector is already done for you.
>>
>
> Yes, but the problem was that i would have prefer not to change the existing structure (not as simple as the one in the example).
> After implementing clear, resize and push_back as suggested by Barend (an example is here http://www.boost.org/doc/libs/1_54_0/libs/geometry/example/c08_custom_non_std_example.cpp), it works !
So more of an adapter pattern. Fair enough.
> Thanks for your help
>
> Renaud
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net