mirror of
https://github.com/boostorg/exception.git
synced 2025-07-04 00:06:40 +02:00
Compare commits
1 Commits
boost-1.46
...
boost-1.43
Author | SHA1 | Date | |
---|---|---|---|
56f905d172 |
@ -28,10 +28,10 @@ namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template <class ErrorInfo,class E>
|
||||
typename ErrorInfo::<span class="RenoLink"><a href="error_info_value_type.html">error_info::value_type</a></span> const * <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>( E const & x );
|
||||
typename ErrorInfo::<span class="RenoLink"><a href="error_info::value_type">error_info::value_type</a></span> const * <span class="RenoLink"><a href="get_error_info">get_error_info</a></span>( E const & x );
|
||||
|
||||
template <class ErrorInfo,class E>
|
||||
typename ErrorInfo::<span class="RenoLink"><a href="error_info_value_type.html">error_info::value_type</a></span> * <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>( E & x );</span></span>
|
||||
typename ErrorInfo::<span class="RenoLink"><a href="error_info::value_type">error_info::value_type</a></span> * <span class="RenoLink"><a href="get_error_info">get_error_info</a></span>( E & x );</span></span>
|
||||
}</pre>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
See also: <span class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a> | <a href="error_info.html">error_info</a></span>
|
||||
|
@ -25,10 +25,10 @@
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> template <class ErrorInfo,class E>
|
||||
typename ErrorInfo::<span class="RenoLink"><a href="error_info_value_type.html">error_info::value_type</a></span> const * get_error_info( E const & x );
|
||||
typename ErrorInfo::<span class="RenoLink"><a href="error_info::value_type">error_info::value_type</a></span> const * <span class="RenoLink"><a href="get_error_info">get_error_info</a></span>( E const & x );
|
||||
|
||||
template <class ErrorInfo,class E>
|
||||
typename ErrorInfo::<span class="RenoLink"><a href="error_info_value_type.html">error_info::value_type</a></span> * get_error_info( E & x );</span>
|
||||
typename ErrorInfo::<span class="RenoLink"><a href="error_info::value_type">error_info::value_type</a></span> * <span class="RenoLink"><a href="get_error_info">get_error_info</a></span>( E & x );</span>
|
||||
}</pre>
|
||||
</div><h4>Requirements:</h4>
|
||||
<div><ul><li> ErrorInfo must be an instance of the <span class="RenoLink"><a href="error_info.html">error_info</a></span> template.</li>
|
||||
|
@ -73,14 +73,12 @@ boost
|
||||
exception_ptr
|
||||
get_bad_alloc()
|
||||
{
|
||||
bad_alloc_ ba;
|
||||
exception_detail::clone_impl<bad_alloc_> c(ba);
|
||||
c <<
|
||||
throw_function(BOOST_CURRENT_FUNCTION) <<
|
||||
static exception_ptr e = boost::copy_exception(
|
||||
bad_alloc_() <<
|
||||
throw_function("boost::current_exception()") <<
|
||||
throw_file(__FILE__) <<
|
||||
throw_line(__LINE__);
|
||||
static exception_ptr ep(new exception_detail::clone_impl<bad_alloc_>(c));
|
||||
return ep;
|
||||
throw_line(__LINE__) );
|
||||
return e;
|
||||
}
|
||||
|
||||
template <int Dummy>
|
||||
|
@ -137,7 +137,7 @@ boost
|
||||
}
|
||||
#ifndef BOOST_NO_RTTI
|
||||
tmp << std::string("Dynamic exception type: ") <<
|
||||
units::detail::demangle((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_.name()) << '\n';
|
||||
units::detail::demangle((be?BOOST_EXCEPTION_DYNAMIC_TYPEID(*be):BOOST_EXCEPTION_DYNAMIC_TYPEID(*se)).type_.name()) << '\n';
|
||||
#endif
|
||||
if( with_what && se )
|
||||
tmp << "std::exception::what: " << wh << '\n';
|
||||
|
@ -75,8 +75,8 @@ boost
|
||||
void
|
||||
release()
|
||||
{
|
||||
if( px_ && px_->release() )
|
||||
px_=0;
|
||||
if( px_ )
|
||||
px_->release();
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -134,7 +134,7 @@ boost
|
||||
|
||||
class exception;
|
||||
|
||||
template <class T>
|
||||
template <class>
|
||||
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 bool release() const = 0;
|
||||
virtual void 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 )
|
||||
{
|
||||
error_info_base const & x = *i->second;
|
||||
tmp << '[' << x.tag_typeid_name() << "] = " << x.value_as_string() << '\n';
|
||||
shared_ptr<error_info_base const> const & x = i->second;
|
||||
tmp << '[' << x->tag_typeid_name() << "] = " << x->value_as_string() << '\n';
|
||||
}
|
||||
tmp.str().swap(diagnostic_info_str_);
|
||||
}
|
||||
@ -140,16 +140,11 @@ boost
|
||||
++count_;
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
release() const
|
||||
{
|
||||
if( --count_ )
|
||||
return false;
|
||||
else
|
||||
{
|
||||
if( !--count_ )
|
||||
delete this;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
refcount_ptr<error_info_container>
|
||||
|
@ -43,6 +43,26 @@
|
||||
|
||||
namespace boost
|
||||
{
|
||||
#if !defined( BOOST_EXCEPTION_DISABLE )
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
template <class E>
|
||||
void
|
||||
throw_exception_( E const & x, char const * current_function, char const * file, int line )
|
||||
{
|
||||
throw_exception(
|
||||
set_info(
|
||||
set_info(
|
||||
set_info(
|
||||
enable_error_info(x),
|
||||
throw_function(current_function)),
|
||||
throw_file(file)),
|
||||
throw_line(line)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_NO_EXCEPTIONS
|
||||
|
||||
void throw_exception( std::exception const & e ); // user defined
|
||||
@ -66,26 +86,6 @@ template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_EXCEPTION_DISABLE )
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
template <class E>
|
||||
BOOST_ATTRIBUTE_NORETURN
|
||||
void
|
||||
throw_exception_( E const & x, char const * current_function, char const * file, int line )
|
||||
{
|
||||
boost::throw_exception(
|
||||
set_info(
|
||||
set_info(
|
||||
set_info(
|
||||
boost::enable_error_info(x),
|
||||
throw_function(current_function)),
|
||||
throw_file(file)),
|
||||
throw_line(line)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <stdlib.h>
|
||||
|
||||
struct
|
||||
my_exception:
|
||||
@ -39,7 +38,6 @@ boost
|
||||
#ifndef BOOST_NO_RTTI
|
||||
BOOST_TEST(s.find("my_tag")!=std::string::npos);
|
||||
#endif
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,16 +28,11 @@ test_type
|
||||
++count_;
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
release()
|
||||
{
|
||||
if( --count_ )
|
||||
return false;
|
||||
else
|
||||
{
|
||||
if( !--count_ )
|
||||
delete this;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user