Boost logo

Boost :

Subject: Re: [boost] Preview 3 of the Geometry Library
From: Stjepan Rajko (stipe_at_[hidden])
Date: 2008-10-21 12:40:43

On Tue, Oct 21, 2008 at 9:24 AM, Bruno Lalande <bruno.lalande_at_[hidden]> wrote:
> Luke, I come back to you about this point from you:
>> Also, your get function returns a reference to coordinate. It should
>> return by value. Many legacy point types may have a public API that
>> prohibits direct access to their members because that is what good
>> little C++ programmers were taught to do in school. Those point classes
>> could not conform to your concept.
> [snip]
> If you are talking about using the getter for write access (that is:
> get<0>(p) = value) it's more problematics. We've discussed about that
> with Barend and it appears that as you say, a legacy point without
> direct access to its coordinates will never be adaptable to such
> traits. I hadn't thought about that before.

Could get<0>(p) return an object (convertible to the coordinate type,
so it can also be used for read access) with an overloaded assignment
operator that does the appropriate thing for write access in such a
point class? It seems like that would solve the problem, but I'm not
sure about any drawbacks.

Kind regards,


P.S. kudos for all the geometry library development and discussions.
I'm looking forward to a well-designed geometry library in boost.

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