Boost logo

Boost :

Subject: Re: [boost] Notice: Boost.Atomic (atomic operations library)
From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2009-12-04 10:40:49


Hi Helge,

In your load and store methods, you have code something like:

     T i;
     T v=*reinterpret_cast<volatile const T *>(&i);
     *reinterpret_cast<volatile T *>(&i)=v;

Shouldn't this be const_cast ? I.e. something like:

     T v = const_cast<volatile const T&>(i);
     const_cast<volatile T &>(i) = v;

(Comments from language lawyers welcome!)

Phil.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk