From 4d18ec3e0d0821fba6544a69a11d683c4b431e8e Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Tue, 5 Oct 2021 18:35:49 -0700 Subject: [PATCH] Removed documentation references to BOOST_THROW_EXCEPTION_CURRENT_FUNCTION --- doc/boost_throw_exception_hpp.html | 1 - doc/frequently_asked_questions.html | 2 +- doc/synopsis.html | 59 ++++++++++++++--------------- 3 files changed, 30 insertions(+), 32 deletions(-) diff --git a/doc/boost_throw_exception_hpp.html b/doc/boost_throw_exception_hpp.html index a99cd9b..2065c46 100644 --- a/doc/boost_throw_exception_hpp.html +++ b/doc/boost_throw_exception_hpp.html @@ -27,7 +27,6 @@ #include <boost/current_function.hpp> #define BOOST_THROW_EXCEPTION(x)\ ::boost::throw_exception( ::boost::enable_error_info(x) <<\ - ::boost::throw_function(BOOST_THROW_EXCEPTION_CURRENT_FUNCTION) <<\ ::boost::throw_file(__FILE__) <<\ ::boost::throw_line((int)__LINE__) ) #else diff --git a/doc/frequently_asked_questions.html b/doc/frequently_asked_questions.html index 2499bb7..b5a06c8 100644 --- a/doc/frequently_asked_questions.html +++ b/doc/frequently_asked_questions.html @@ -25,7 +25,7 @@

The cost is that boost::exception is added as a base of the exception emitted by boost::throw_exception (unless the passed type already derives from boost::exception.)

Calling boost::throw_exception does not cause dynamic memory allocations.

What is the cost of BOOST_THROW_EXCEPTION?

-

In addition to calling boost::throw_exception, BOOST_THROW_EXCEPTION invokes __FILE__, __LINE__ and the BOOST_THROW_EXCEPTION_CURRENT_FUNCTION macros. The space required to store the information is already included in sizeof(boost::exception).

+

In addition to calling boost::throw_exception, BOOST_THROW_EXCEPTION invokes __FILE__ and __LINE__ macros. The space required to store the information is already included in sizeof(boost::exception).

Calling BOOST_THROW_EXCEPTION does not cause dynamic memory allocations.

Should I use boost::throw_exception or BOOST_THROW_EXCEPTION or just throw?

The benefit of calling boost::throw_exception instead of using throw directly is that it ensures that the emitted exception derives from boost::exception and that it is compatible with boost::current_exception.

diff --git a/doc/synopsis.html b/doc/synopsis.html index 95d12db..0f94ed5 100644 --- a/doc/synopsis.html +++ b/doc/synopsis.html @@ -29,15 +29,15 @@ boost exception { protected: - + exception(); - exception( exception const & x ); - ~exception(); - }; - + exception( exception const & x ); + ~exception(); + }; + template <class Tag,class T> - class error_info; - + class error_info; + typedef error_info<struct throw_function_,char const *> throw_function; typedef error_info<struct throw_file_,char const *> throw_file; typedef error_info<struct throw_line_,int> throw_line; @@ -60,14 +60,14 @@ boost error_info { public: - - typedef T value_type; - - error_info( value_type const & v ); + + typedef T value_type; + + error_info( value_type const & v ); value_type const & value() const; - value_type & value(); - }; - + value_type & value(); + }; + template <class E, class Tag, class T> E const & operator<<( E const & x, error_info<Tag,T> const & v ); } @@ -104,11 +104,11 @@ boost template <class E> std::string diagnostic_information( E const & e, bool verbose=true ); - - std::string diagnostic_information( exception_ptr const & p, bool verbose=true ); - - char const * diagnostic_information_what( boost::exception const & e, bool verbose=true ) throw(); - + + std::string diagnostic_information( exception_ptr const & p, bool verbose=true ); + + char const * diagnostic_information_what( boost::exception const & e, bool verbose=true ) throw(); + std::string current_exception_diagnostic_information(); }

#include <boost/exception/current_exception_cast.hpp>

@@ -130,17 +130,17 @@ boost public boost::exception { ---unspecified--- - }; - - typedef error_info<struct tag_original_exception_type,std::type_info const *> original_exception_type; - - typedef ---unspecified--- exception_ptr; - + }; + + typedef error_info<struct tag_original_exception_type,std::type_info const *> original_exception_type; + + typedef ---unspecified--- exception_ptr; + template <class T> - exception_ptr copy_exception( T const & e ); - - exception_ptr current_exception(); - + exception_ptr copy_exception( T const & e ); + + exception_ptr current_exception(); + void rethrow_exception( exception_ptr const & ep ); }

#include <boost/exception/enable_current_exception.hpp>

@@ -158,7 +158,6 @@ boost #include <boost/current_function.hpp> #define BOOST_THROW_EXCEPTION(x)\ ::boost::throw_exception( ::boost::enable_error_info(x) <<\ - ::boost::throw_function(BOOST_THROW_EXCEPTION_CURRENT_FUNCTION) <<\ ::boost::throw_file(__FILE__) <<\ ::boost::throw_line((int)__LINE__) ) #else