Modify

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#6999 closed Feature Requests (fixed)

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 (2)

anymove.patch (2.1 KB) - added by tr3w <tr3w@…> 5 years ago.
Naive move semantics implementation.
any.patch (16.3 KB) - added by Antony Polukhin 5 years ago.
Correct patch with tests

Download all attachments as: .zip

Change History (20)

Changed 5 years ago by tr3w <tr3w@…>

Attachment: anymove.patch added

Naive move semantics implementation.

comment:1 Changed 5 years 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 5 years ago by Antony Polukhin

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 5 years ago by Antony Polukhin (previous) (diff)

Changed 5 years ago by Antony Polukhin

Attachment: any.patch added

Correct patch with tests

comment:3 Changed 5 years ago by Antony Polukhin

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

comment:4 Changed 5 years ago by Antony Polukhin

(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 5 years ago by Antony Polukhin

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

comment:6 Changed 5 years ago by Antony Polukhin

Resolution: fixed
Status: newclosed

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

comment:7 Changed 5 years ago by Antony Polukhin

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

comment:8 Changed 5 years ago by Antony Polukhin

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

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

comment:9 Changed 5 years ago by Antony Polukhin

(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 5 years ago by Antony Polukhin

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

comment:11 Changed 5 years ago by Antony Polukhin

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

comment:12 Changed 4 years ago by Antony Polukhin

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

comment:13 Changed 4 years ago by Antony Polukhin

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

comment:14 Changed 4 years ago by Antony Polukhin

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

comment:15 Changed 4 years ago by Antony Polukhin

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

comment:16 Changed 4 years ago by Antony Polukhin

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

comment:17 Changed 4 years ago by Antony Polukhin

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

comment:18 Changed 4 years ago by anonymous

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain nasonov.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.