detail/atomic_count_gcc.hpp error

trying to do: boost::detail::atomic_count c(0); std::cout << long(c) << std::endl; with gcc 3.2.2 gives: /usr/include/boost/detail/atomic_count_gcc.hpp: In member function `boost::detail::atomic_count::operator long int() const': /usr/include/boost/detail/atomic_count_gcc.hpp:46: invalid conversion from ` const _Atomic_word*' to `volatile _Atomic_word*' in the following function: operator long() const { return __exchange_and_add(&value_, 0); } The problem can be solved by making the private member "_Atomic_word value_" mutable. renej ps I know I shouldn't use detail/* stuff directly... --

Rene Jager wrote:
trying to do:
boost::detail::atomic_count c(0); std::cout << long(c) << std::endl;
with gcc 3.2.2 gives:
/usr/include/boost/detail/atomic_count_gcc.hpp: In member function `boost::detail::atomic_count::operator long int() const': /usr/include/boost/detail/atomic_count_gcc.hpp:46: invalid conversion from ` const _Atomic_word*' to `volatile _Atomic_word*'
in the following function:
operator long() const { return __exchange_and_add(&value_, 0); }
The problem can be solved by making the private member "_Atomic_word value_" mutable.
Fixed in CVS.

"Peter Dimov" wrote:
operator long() const { return __exchange_and_add(&value_, 0); }
The problem can be solved by making the private member "_Atomic_word value_" mutable.
Fixed in CVS.
Also second problem from: http://lists.boost.org/MailArchives/boost/msg57537.php may be reconsidered (if not done already - I don't see latest changes). (Boost.FSM triggered these problems and requires the fix.) /Pavel

Pavel Vozenilek wrote:
"Peter Dimov" wrote:
operator long() const { return __exchange_and_add(&value_, 0); }
The problem can be solved by making the private member "_Atomic_word value_" mutable.
Fixed in CVS.
Also second problem from: http://lists.boost.org/MailArchives/boost/msg57537.php may be reconsidered (if not done already - I don't see latest changes).
Yes, I fixed that, too.
participants (3)
-
Pavel Vozenilek
-
Peter Dimov
-
Rene Jager