Boost logo

Boost Users :

Subject: [Boost-users] [Thread] 1.53 fails to compile working code
From: Szymon Gatner (szymon.gatner_at_[hidden])
Date: 2013-02-07 14:17:08


Hello,

following minimal code compiles fine with 1.52 and
BOOST_THREAD_VERSION defined to 3 but gives compilation error with
1.53 release (Visual Studio 2008 SP1, Win 7):

#include <boost/move/move.hpp>
#include <boost/thread/future.hpp>

class Dummy
{
public:

  Dummy& operator=(BOOST_RV_REF(Dummy) other);

  Dummy& operator=(BOOST_COPY_ASSIGN_REF(Dummy) other);

  BOOST_COPYABLE_AND_MOVABLE(Dummy);
};

Dummy createDummy();

int main()
{
  boost::future<Dummy> df = boost::async(&createDummy);
}

Error message:

1>------ Build started: Project: boost_153_test, Configuration: Debug
Win32 ------
1>Compiling...
1>main.cpp
1>c:\devel\boost_1_53_0\boost\thread\future.hpp(661) : error C2665:
'boost::detail::future_traits<T>::init' : none of the 2 overloads
could convert all the argument types
1> with
1> [
1> T=Dummy
1> ]
1> c:\devel\boost_1_53_0\boost\thread\future.hpp(525): could be
'void boost::detail::future_traits<T>::init(boost::scoped_ptr<T>
&,Dummy &)'
1> with
1> [
1> T=Dummy
1> ]
1> c:\devel\boost_1_53_0\boost\thread\future.hpp(530): or
'void boost::detail::future_traits<T>::init(boost::scoped_ptr<T>
&,boost::rv<T> &)'
1> with
1> [
1> T=Dummy
1> ]
1> while trying to match the argument list
'(boost::scoped_ptr<T>, const Dummy)'
1> with
1> [
1> T=Dummy
1> ]
1> c:\devel\boost_1_53_0\boost\thread\future.hpp(655) : while
compiling class template member function 'void
boost::detail::future_object<T>::set_value_at_thread_exit(const T &)'
1> with
1> [
1> T=Dummy
1> ]
1> c:\devel\boost_1_53_0\boost\thread\future.hpp(1542) : see
reference to class template instantiation
'boost::detail::future_object<T>' being compiled
1> with
1> [
1> T=Dummy
1> ]
1> c:\devel\boost_1_53_0\boost\thread\future.hpp(1415) : see
reference to class template instantiation 'boost::shared_future<R>'
being compiled
1> with
1> [
1> R=Dummy
1> ]
1> c:\devel\boost_1_53_0\boost\thread\future.hpp(1413) : while
compiling class template member function
'boost::future<R>::future(boost::rv<T> &)'
1> with
1> [
1> R=Dummy,
1> T=boost::future<Dummy>
1> ]
1> c:\users\bravo\documents\visual studio
2008\projects\boost_153_test\boost_153_test\main.cpp(19) : see
reference to class template instantiation 'boost::future<R>' being
compiled
1> with
1> [
1> R=Dummy
1> ]
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 ==========

Btw: why BOOST_THREAD_VERSION is still 2 when documentation says it is
4.0.0 as of boost 1.53?

Regards,
Szymon Gatner

-- 
Szymon Gatner
The Lordz Games Studio
www.thelordzgamesstudio.com

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