Boost logo

Boost :

From: Brock Peabody (brock.peabody_at_[hidden])
Date: 2003-09-05 11:38:02


These work:

   boost::scoped_ptr<volatile bool>(new volatile bool(true));

   boost::shared_ptr<bool>(new bool(true));

But this fails:

   boost::shared_ptr<volatile bool>(new volatile bool(true));

With the following error on VC 7.1:

c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\boost\shared_ptr.hpp(116) : error C2664: 'void
boost::detail::sp_enable_shared_from_this(const void *,const void *,const
boost::detail::shared_count &)' : cannot convert parameter 1 from 'volatile
bool *' to 'const void *'
        Conversion loses qualifiers
        test.cpp(9) : see reference to function template instantiation
'boost::shared_ptr<T>::shared_ptr<volatile bool>(Y *)' being compiled
        with
        [
            T=volatile bool,
            Y=volatile bool
        ]

Am I doing something wrong?

Thanks!

Brock


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