forked from boostorg/exception
merging changes from trunk.
[SVN r63565]
This commit is contained in:
@ -73,12 +73,14 @@ boost
|
||||
exception_ptr
|
||||
get_bad_alloc()
|
||||
{
|
||||
static exception_ptr e = boost::copy_exception(
|
||||
bad_alloc_() <<
|
||||
throw_function("boost::current_exception()") <<
|
||||
bad_alloc_ ba;
|
||||
exception_detail::clone_impl<bad_alloc_> c(ba);
|
||||
c <<
|
||||
throw_function(BOOST_CURRENT_FUNCTION) <<
|
||||
throw_file(__FILE__) <<
|
||||
throw_line(__LINE__) );
|
||||
return e;
|
||||
throw_line(__LINE__);
|
||||
static exception_ptr ep(new exception_detail::clone_impl<bad_alloc_>(c));
|
||||
return ep;
|
||||
}
|
||||
|
||||
template <int Dummy>
|
||||
|
@ -75,8 +75,8 @@ boost
|
||||
void
|
||||
release()
|
||||
{
|
||||
if( px_ )
|
||||
px_->release();
|
||||
if( px_ && px_->release() )
|
||||
px_=0;
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -134,7 +134,7 @@ boost
|
||||
|
||||
class exception;
|
||||
|
||||
template <class>
|
||||
template <class T>
|
||||
class shared_ptr;
|
||||
|
||||
namespace
|
||||
@ -150,7 +150,7 @@ boost
|
||||
virtual shared_ptr<error_info_base> get( type_info_ const & ) const = 0;
|
||||
virtual void set( shared_ptr<error_info_base> const &, type_info_ const & ) = 0;
|
||||
virtual void add_ref() const = 0;
|
||||
virtual void release() const = 0;
|
||||
virtual bool release() const = 0;
|
||||
virtual refcount_ptr<exception_detail::error_info_container> clone() const = 0;
|
||||
|
||||
protected:
|
||||
|
@ -114,8 +114,8 @@ boost
|
||||
tmp << header;
|
||||
for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i )
|
||||
{
|
||||
shared_ptr<error_info_base const> const & x = i->second;
|
||||
tmp << '[' << x->tag_typeid_name() << "] = " << x->value_as_string() << '\n';
|
||||
error_info_base const & x = *i->second;
|
||||
tmp << '[' << x.tag_typeid_name() << "] = " << x.value_as_string() << '\n';
|
||||
}
|
||||
tmp.str().swap(diagnostic_info_str_);
|
||||
}
|
||||
@ -140,11 +140,16 @@ boost
|
||||
++count_;
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
release() const
|
||||
{
|
||||
if( !--count_ )
|
||||
if( --count_ )
|
||||
return false;
|
||||
else
|
||||
{
|
||||
delete this;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
refcount_ptr<error_info_container>
|
||||
|
Reference in New Issue
Block a user