Boost logo

Boost :

Subject: Re: [boost] [TypeErasure] assignment operator of any references
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-07-18 17:49:41


AMDG

On 07/18/2012 02:15 PM, Vicente J. Botet Escriba wrote:
> Hi,
>
> The References section constains this example:
>
> int i, j;
> any<typeid_<>, _self&> x(i), y(j);
> x = y; // error
>
> The following basic c++ code
>
> int i=1, j=0;
> int& x(i);
> int& y(j);
> x = y; // [1]
>
> works and the expected value of x after [1] is 0.
>
> Which concept requirements should I add to make the following work?
> assignable?
>

Yes. assignable<> should work.

> int i, j;
> any<mpl::vector<typeid_<>, ...>, _self&> x(i), y(j);
> x = y; // no error
>

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk