Compare commits

..

2 Commits

Author SHA1 Message Date
6bbcecc634 Release 1.45.0
[SVN r66646]
2010-11-19 15:17:53 +00:00
eb810d49cb merging changes from trunk.
[SVN r63565]
2010-07-03 21:32:02 +00:00
8 changed files with 53 additions and 39 deletions

View File

@ -28,10 +28,10 @@ namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class ErrorInfo,class E&gt;
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 &amp; x );
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 &amp; x );
template &lt;class ErrorInfo,class E&gt;
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 &amp; x );</span></span>
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 &amp; 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>&nbsp;| <a href="error_info.html">error_info</a></span>

View File

@ -25,10 +25,10 @@
boost
{
<span class="RenoIncludeSPAN"> template &lt;class ErrorInfo,class E&gt;
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 &amp; x );
typename ErrorInfo::<span class="RenoLink"><a href="error_info_value_type.html">error_info::value_type</a></span> const * get_error_info( E const &amp; x );
template &lt;class ErrorInfo,class E&gt;
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 &amp; x );</span>
typename ErrorInfo::<span class="RenoLink"><a href="error_info_value_type.html">error_info::value_type</a></span> * get_error_info( E &amp; 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>

View File

@ -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>

View File

@ -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:

View File

@ -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>

View File

@ -43,26 +43,6 @@
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
@ -86,6 +66,26 @@ 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(
enable_error_info(x),
throw_function(current_function)),
throw_file(file)),
throw_line(line)));
}
}
#endif
} // namespace boost
#endif // #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED

View File

@ -9,6 +9,7 @@
#include <boost/exception/info.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <stdlib.h>
struct
my_exception:
@ -38,6 +39,7 @@ boost
#ifndef BOOST_NO_RTTI
BOOST_TEST(s.find("my_tag")!=std::string::npos);
#endif
exit(0);
}
}

View File

@ -28,11 +28,16 @@ test_type
++count_;
}
void
bool
release()
{
if( !--count_ )
if( --count_ )
return false;
else
{
delete this;
return true;
}
}
private: