Boost logo

Boost Users :

From: Simone Finotti (s.finotti_at_[hidden])
Date: 2003-02-20 03:23:17


hi all,
I don't know if this is the right place to report bug, if it's not please
forgive me. I was trying to use boost/shared_ptr.hpp class, so I defined
BOOST_NO_EXCEPTIONS because my compiler doesn't support C++ exceptions, but
I receive this error:

..\..\boost_1_29_0\boost/detail/shared_count.hpp(122) : error C2039:
'use_count_is_zero' : is not a member of 'boost'
..\..\boost_1_29_0\boost/detail/shared_count.hpp(122) : error C2065:
'use_count_is_zero' : undeclared identifier

in detail, here's an excerpt from shared_count.hpp, where the compiler gives
the error:

    void add_ref()
    {
#ifdef BOOST_HAS_THREADS
        mutex_type::scoped_lock lock(mtx_);
#endif
        if(use_count_ == 0 && weak_count_ != 0)
boost::throw_exception(boost::use_count_is_zero());
        ++use_count_;
        ++weak_count_;
    }

use_count_is_zero is not defined because it's defined, in the same file, as:

#ifndef BOOST_NO_EXCEPTIONS

class use_count_is_zero: public std::exception
{
public:

    virtual char const * what() const throw()
    {
        return "boost::use_count_is_zero";
    }
};

#endif

is there a way to make it work?

--
Simone

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