Modify

Ticket #6999 (closed Feature Requests: fixed)

Opened 22 months ago

Last modified 3 months ago

Boost.Move support in Boost.Any

Reported by: tr3w <tr3w@…> Owned by: nasonov
Milestone: To Be Determined Component: any
Version: Boost 1.49.0 Severity: Problem
Keywords: Cc: antoshkka@…

Description

Currently there is no support for move semantics in Boost.Any. It would be nice if the boost::any itself could be movable, but more importantly if it can store values of movable types without copying.

Attachments

anymove.patch Download (2.1 KB) - added by tr3w <tr3w@…> 22 months ago.
Naive move semantics implementation.
any.patch Download (16.3 KB) - added by apolukhin 13 months ago.
Correct patch with tests

Change History

Changed 22 months ago by tr3w <tr3w@…>

Naive move semantics implementation.

comment:1 Changed 22 months ago by tr3w <tr3w@…>

I added a naive implementation which seems to work under MSVC 2010, MINGW 4.6 and ICL 12.0. But I never used Boost.Move or rvalue references before, especially not with templates, so probably a deep review is required before merging. :)

comment:2 Changed 13 months ago by apolukhin

  • Cc antoshkka@… added

Naive patch (anymove.patch) does not work well on trunk version of boost.

Attached new patch with a series of tests. Tests pass on MSVC11 and GCC-4.6

Last edited 13 months ago by apolukhin (previous) (diff)

Changed 13 months ago by apolukhin

Correct patch with tests

comment:3 Changed 12 months ago by apolukhin

(In [83901]) Added rvalue references support via Boost.Move to Boost.Any (refs #6999)

comment:4 Changed 12 months ago by apolukhin

(In [83917]) Do not use Boost.Move for rvalues emulation in Boost.Any (now rvalues in Boost.Any work only on C++11 compilers) (refs #6999)

comment:5 Changed 12 months ago by apolukhin

(In [83976]) Added missing BOOST_NOEXCEPT to destructor and updated documentation of Boost.Any (refs #6999)

comment:6 Changed 12 months ago by apolukhin

  • Status changed from new to closed
  • Resolution set to fixed

(In [84086]) Merge Boost.Any from trunk (fixes #6999)

comment:7 Changed 12 months ago by apolukhin

(In [84140]) Make Boost.Any more conformant to draft:

comment:8 Changed 12 months ago by apolukhin

(In [84182]) Make Boost.Any more conformant to draft:

  • add missing BOOST_NOEXCEPT (partially refs #6999)
  • add clear() method
  • microoptimization

comment:9 Changed 12 months ago by apolukhin

(In [84229]) Make Boost.Any more conformant to draft:

  • tune boost::any_cast to work with temporaries and add some more test (partially refs #6999)

comment:10 Changed 12 months ago by apolukhin

(In [84274]) Remove incorrect tests from Boost.Any (refs #6999)

comment:11 Changed 11 months ago by apolukhin

(In [84406]) Add workaround for MSVC-10 bug: disable test (partially refs #6999)

comment:12 Changed 11 months ago by apolukhin

(In [84603]) Docs update: ValueType? of Boost.Any shall be CopyConstructible?, not Move constructible (refs #6999)

comment:13 Changed 11 months ago by apolukhin

(In [84604]) Docs update: ValueType? of Boost.Any shall be CopyConstructible?, not Move constructible (refs #6999)

comment:14 Changed 9 months ago by apolukhin

(In [85152]) Added some more C++11 tests for Boost.Any (refs #6999)

comment:15 Changed 9 months ago by apolukhin

(In [85158]) Slightly change file and test names from r85152 to better reflect test (refs #6999)

comment:16 Changed 9 months ago by apolukhin

(In [85238]) Add tests for any.clear() and workaround Intel issue in tests (refs #6999)

comment:17 Changed 8 months ago by apolukhin

(In [85511]) Merge tests of Boost.Any from trunk (refs #6999)

comment:18 Changed 3 months ago by anonymous

Why "const" in "decay<const ValueType?>" in the template conversion ctor of any ?

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.