Boost logo

Geometry :

Subject: Re: [geometry] Move-enabled Geometries
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2013-02-26 06:10:40


On 26 February 2013 00:54, Adam Wulkiewicz <adam.wulkiewicz_at_[hidden]> wrote:
> Hi,
>
> Do we plan to support move semantics in geometries using some containers
> like ring, polygon, etc?

IMHO, it's a natural step following the release of the latest C++ standard.
So, yes, we should plan to support move semantics.

> We could use Boost.Move to support older compilers.

Yes.
As we live within Boost ecosystem, we shall follow backward
compatibility imposed by Boost.
Boost has't switched to C++11 leaving older compilers unsupported,
thus we shouldn't either.

> It would require:
>
> - use of BOOST_COPYABLE_AND_MOVABLE()
> - implementation of copy and move ctors
> - implementation of copy and move assignment

copy *or* move

There may be situations where we may want the latter but not both.

Geometry often relies on generated (implicit) copy operations
so we should be careful as implementing move semantics will disable
those (C++11 marks implicit copy ctor/assignment as deleted).

> - implementation of additional copy ctor to ensure backward compatibility

Indeed.

> - probably switching from default std::vector to boost::container::vector

For compatibility sake, it sounds reasonable, but we have to discuss
pros and cons
versus standard containers, I guess.
(I haven't used standard equivalents from boost::container myself.)

Best regards,

--
Mateusz Loskot, http://mateusz.loskot.net

Geometry list run by mateusz at loskot.net