Hi Ansders,

Welcome back ;-)

My inclination would be to implement an assignment operator and make
it protected rather than disable the warning.  Could you try this and
post the results if successful?

Robert.

On Thu, Sep 3, 2009 at 5:30 AM, Anders Backman<[email protected]> wrote:
> Hi!
> Compiling the following class in VisualStudio with the highest varning level
> /W4 results in the warning:
> OpenSceneGraph\include\OpenThreads/ReadWriteMutex(94) : warning C4512:
> 'OpenThreads::ScopedReadLock' : assignment operator could not be generated
>
> class ScopedReadLock
> {
>     public:
>
>         ScopedReadLock(ReadWriteMutex& mutex):_mutex(mutex) {
> _mutex.readLock(); }
>         ~ScopedReadLock() { _mutex.readUnlock(); }
>
>     protected:
>         ReadWriteMutex& _mutex;
> };
>
> It would be nice if this warning could be avoided.
> Unfortunately in this case there is basically only one way of doing that:
> #ifdef _WIN32
>   // Disable warning about assignment operator could not be generated due to
> reference members.
>   #pragma warning( disable: 4512 )
> #endif
> /Anders
>
> --
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to