Boost logo

Boost Users :

Subject: Re: [Boost-users] [move] non-inline move constructor - won't compile
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2013-11-02 11:28:21


Le 02/11/13 12:02, Krzysztof Czainski a écrit :
> Hi,
>
> I've been trying to writhe a non-inline move constructor, to place
> its' implementation in a .cpp file. I'm having problems compiling my
> code, which I managed to simplify (after examining output of the
> preprocessor) down to this short code snippet:
>
> #include <boost/move/core.hpp>
>
> struct X
> {
> X( ::boost::rv< X >& x );
> operator ::boost::rv<X>&() { return *static_cast< ::boost::rv<X>*
> >(this); }
> };
>
> X::X( ::boost::rv< X >& x ) {}
>
> Compiling a .cpp file with the above contents gives me:
>
> a.cpp:41:1: error: prototype for 'X::X(boost::rv<X>&)' does not match
> any in class 'X'
> X::X( ::boost::rv< X >& x ) {}
> ^
> a.cpp:35:8: error: candidates are: X::X(const X&)
> struct X
> ^
> a.cpp:37:5: error: X::X(boost::rv<X>&)
> X( ::boost::rv< X >& x );
> ^
>
> I'm using MinGW gcc 4.8.1 in default -std mode (not-C++11 mode),
> boost-1.54.
It works for me with clang-3.1 and clang-3.2, but not with gcc :( Really
curious.
>
> Am I doing something wrong here, or is it a bug in the compiler?
>
I would say that it is a bug on the compiler.

Best,
Vicente


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net