|
Boost Users : |
Subject: [Boost-users] [thread] boost-1.36's upgrade_to_unique_lock doesn't compile on C++0x mode
From: Rodolfo Lima (rodolfo_at_[hidden])
Date: 2008-10-07 20:20:27
The following code doesn't compile with gcc-4.3.2 (and gcc-4.4.0), and
boost-1.36 (and boost-trunk of 2008/10/07) when using -std=c++0x on linux.
#include <boost/thread/shared_mutex.hpp>
int main()
{
boost::shared_mutex mtx;
boost::upgrade_lock<boost::shared_mutex> lk(mtx);
boost::upgrade_to_unique_lock<boost::shared_mutex> lk2(lk);
}
gcc spits:
g++-4.4.0-alpha20081003 -std=c++0x -I src/boost-trunk teste.cpp -o teste
In file included from src/boost-trunk/boost/thread/pthread/mutex.hpp:11,
from src/boost-trunk/boost/thread/mutex.hpp:16,
from
src/boost-trunk/boost/thread/pthread/shared_mutex.hpp:12,
from src/boost-trunk/boost/thread/shared_mutex.hpp:16,
from teste.cpp:1:
src/boost-trunk/boost/thread/locks.hpp: In destructor
'boost::upgrade_to_unique_lock<Mutex>::~upgrade_to_unique_lock() [with
Mutex = boost::shared_mutex]':
teste.cpp:8: instantiated from here
src/boost-trunk/boost/thread/locks.hpp:807: error: no match for
'operator=' in
'*((boost::upgrade_to_unique_lock<boost::shared_mutex>*)this)->boost::upgrade_to_unique_lock<boost::shared_mutex>::source
= boost::move [with Mutex =
boost::shared_mutex](((boost::unique_lock<boost::shared_mutex>&&)(&((boost::upgrade_to_unique_lock<boost::shared_mutex>*)this)->boost::upgrade_to_unique_lock<boost::shared_mutex>::exclusive)))'
src/boost-trunk/boost/thread/locks.hpp:643: note: candidates are:
boost::upgrade_lock<Mutex>&
boost::upgrade_lock<Mutex>::operator=(boost::upgrade_lock<Mutex>&) [with
Mutex = boost::shared_mutex]
src/boost-trunk/boost/thread/locks.hpp:694: note:
boost::upgrade_lock<Mutex>&
boost::upgrade_lock<Mutex>::operator=(boost::detail::thread_move_t<boost::upgrade_lock<Mutex>
>) [with Mutex = boost::shared_mutex]
src/boost-trunk/boost/thread/locks.hpp:701: note:
boost::upgrade_lock<Mutex>&
boost::upgrade_lock<Mutex>::operator=(boost::detail::thread_move_t<boost::unique_lock<Mutex>
>) [with Mutex = boost::shared_mutex]
src/boost-trunk/boost/thread/locks.hpp: In constructor
'boost::unique_lock<Mutex>::unique_lock(boost::upgrade_lock<Mutex>&&)
[with Mutex = boost::shared_mutex]':
src/boost-trunk/boost/thread/locks.hpp:801: instantiated from
'boost::upgrade_to_unique_lock<Mutex>::upgrade_to_unique_lock(boost::upgrade_lock<Mutex>&)
[with Mutex = boost::shared_mutex]'
teste.cpp:8: instantiated from here
src/boost-trunk/boost/thread/locks.hpp:775: error: request for member
'unlock_upgrade_and_lock' in
'((boost::unique_lock<boost::shared_mutex>*)this)->boost::unique_lock<boost::shared_mutex>::m',
which is of non-class type 'boost::shared_mutex*'
It compiles fine in non std++0x mode
Regards,
Rodolfo Lima
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