Boost logo

Boost :

Subject: Re: [boost] [any] Divergence between Boost.Any and standard library proposal
From: Beman Dawes (bdawes_at_[hidden])
Date: 2013-05-06 08:18:13

On Sat, May 4, 2013 at 3:09 PM, Antony Polukhin <antoshkka_at_[hidden]> wrote:
>>> Looks like I broke it in .
>> Should I create a new ticket:-)
> Fixed in trunk.


> BTW, draft tells nothing about any_cast<type&&>(instance_of_any).
> Current Boost version will return rvalue if `instance_of_any` is not
> const and fail to compile other way.


To movable_test.cpp, I added:

    std::cout << "move assign from any contents by rvalue reference"
<< std::endl;
    m = any_cast<movable&&>(x1);

Worked for the current Boost trunk with both GCC and VC++, but VC++
2012 produced a warning:

c:\boost\trunk\boost\any.hpp(272): warning C4172: returning address of
local variable or temporary
          c:\dot16\dot16\test\movable_test.cpp(61) : see reference to
function template instantiation 'ValueType
boost::any_cast<movable&&>(boost::any &)' being compiled
              ValueType=movable &&


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