Boost logo

Boost Users :

Subject: Re: [Boost-users] [Thread] 1.53 fails to compile working code
From: Szymon Gatner (szymon.gatner_at_[hidden])
Date: 2013-02-10 06:36:33


2013/2/10 Vicente J. Botet Escriba <vicente.botet_at_[hidden]>:
>
> I have made some updates to future.hpp and now the two tests work correctly.
> I don't know if all the modifications are absolutely needed.
>
> Please, could you give it a try?
>

Original test code compiles OK now but unfortunately fails in other place:

#include <boost/thread/future.hpp>
#include <boost/container/vector.hpp>

typedef boost::container::vector<int> V;

int main()
{
  boost::future<V> vf;
  V v(boost::move(vf.get())); // fails to compile
  // also fails: V v = boost::move(vf.get())
}

with error:

1>------ Build started: Project: boost_153_test, Configuration: Debug
Win32 ------
1>Compiling...
1>main.cpp
1>c:\users\bravo\documents\visual studio
2008\projects\boost_153_test\boost_153_test\main.cpp(9) : error C2664:
'boost::rv<T> &boost::move<boost::container::vector<int>>(T &)' :
cannot convert parameter 1 from 'boost::container::vector<T>' to
'boost::container::vector<T> &'
1> with
1> [
1> T=V
1> ]
1> and
1> [
1> T=int
1> ]
1> and
1> [
1> T=int
1> ]
1> Exactly the same type
1> followed by
1> Call to user-defined-conversion
'boost::container::vector<T>::operator
boost::rv<boost::container::vector<T>> &(void)'
1> with
1> [
1> T=int
1> ]
1> c:\devel\boost_1_53_0\boost\container\vector.hpp(413) : see
declaration of 'boost::container::vector<T>::operator boost::rv<T> &'
1> with
1> [
1> T=int
1> ]
1> and
1> [
1> T=V
1> ]
1> followed by
1> Binding to reference
1>Build log was saved at "file://c:\Users\Bravo\Documents\Visual
Studio 2008\Projects\boost_153_test\boost_153_test\Debug\BuildLog.htm"
1>boost_153_test - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Regards,
Szymon


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