Opened 10 years ago

Closed 9 years ago

Last modified 9 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@…> 10 years ago.
Naive move semantics implementation.
any.patch (16.3 KB ) - added by Antony Polukhin 10 years ago.
Correct patch with tests

Download all attachments as: .zip

Change History (20)

by tr3w <tr3w@…>, 10 years ago

Attachment: anymove.patch added

Naive move semantics implementation.

comment:1 by tr3w <tr3w@…>, 10 years ago

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 by Antony Polukhin, 10 years ago

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

by Antony Polukhin, 10 years ago

Attachment: any.patch added

Correct patch with tests

comment:3 by Antony Polukhin, 10 years ago

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

comment:4 by Antony Polukhin, 10 years ago

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

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

comment:6 by Antony Polukhin, 9 years ago

Resolution: fixed
Status: newclosed

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

comment:7 by Antony Polukhin, 9 years ago

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

  • decay ValueType (partially refs #6999)
  • experimental any_cast<rvalue&&>

comment:8 by Antony Polukhin, 9 years ago

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

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

comment:9 by Antony Polukhin, 9 years ago

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

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

comment:11 by Antony Polukhin, 9 years ago

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

comment:12 by Antony Polukhin, 9 years ago

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

comment:13 by Antony Polukhin, 9 years ago

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

comment:14 by Antony Polukhin, 9 years ago

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

comment:15 by Antony Polukhin, 9 years ago

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

comment:16 by Antony Polukhin, 9 years ago

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

comment:17 by Antony Polukhin, 9 years ago

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

comment:18 by anonymous, 9 years ago

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

Note: See TracTickets for help on using tickets.