Boost logo

Boost :

Subject: Re: [boost] [type_erasure] overloading macro
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2013-02-26 16:47:02


AMDG

On 02/26/2013 01:24 PM, Christophe Henry wrote:
>>
>> BOOST_TYPE_ERASURE_MEMBER now supports rvalue references.
>>
> I don't manage to get it to work, am I missing something? I get a "no
> matching function call" (gcc 4.7.2).
>

Works for me:
$ /usr/local/gcc-4.7.2/bin/g++ -c -std=c++11 scratch.cpp -Itrunk
-Itype_erasure

(I just added #includes and using directives)

sandbox_at_83160, trunk_at_83162

Can you give me the complete test case,
svn revision numbers and error messages?

>
> BOOST_TYPE_ERASURE_MEMBER((n1)(has_foo), foo);
>
> struct Data{};
>
> struct Test
> {
> void foo(Data&&)const
> {
> std::cout << "foo(Data&&) called" << std::endl;
> }
> void foo(int,double)const
> {
> std::cout << "foo(int,double) called" << std::endl;
> }
> };
>
> int main()
> {
> Test t;
> any<
> mpl::vector<
> n1::has_foo<void(Data&&),const _self>,
> n1::has_foo<void(int, double),const _self>,
> copy_constructible<>
> >
> > x (t);
> //x.foo(Data()); // ===> this will not compile
> x.foo(1,1.0); // calls foo(int, double)
> return 0;
> }
>

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