diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7383a16..ec5c0c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,11 +17,6 @@ jobs: fail-fast: false matrix: include: - - toolset: gcc-4.8 - cxxstd: "11" - os: ubuntu-latest - container: ubuntu:18.04 - install: g++-4.8 - toolset: gcc-5 cxxstd: "11,14,1z" os: ubuntu-latest @@ -38,14 +33,17 @@ jobs: container: ubuntu:18.04 - toolset: gcc-8 cxxstd: "11,14,17,2a" - os: ubuntu-20.04 + os: ubuntu-latest + container: ubuntu:20.04 install: g++-8 - toolset: gcc-9 cxxstd: "11,14,17,2a" - os: ubuntu-20.04 + os: ubuntu-latest + container: ubuntu:20.04 - toolset: gcc-10 cxxstd: "11,14,17,2a" - os: ubuntu-20.04 + os: ubuntu-latest + container: ubuntu:20.04 install: g++-10 - toolset: gcc-11 cxxstd: "11,14,17,2a" @@ -64,6 +62,11 @@ jobs: os: ubuntu-latest container: ubuntu:24.04 install: g++-14 + - toolset: gcc-15 + cxxstd: "11,14,17,20,23,2c" + os: ubuntu-latest + container: ubuntu:25.04 + install: g++-15 - toolset: clang compiler: clang++-3.9 cxxstd: "11,14" @@ -85,35 +88,45 @@ jobs: - toolset: clang compiler: clang++-6.0 cxxstd: "11,14,17" - os: ubuntu-20.04 + os: ubuntu-latest + container: ubuntu:20.04 install: clang-6.0 - toolset: clang compiler: clang++-7 cxxstd: "11,14,17" - os: ubuntu-20.04 + os: ubuntu-latest + container: ubuntu:20.04 install: clang-7 - toolset: clang compiler: clang++-8 cxxstd: "11,14,17" - os: ubuntu-20.04 + os: ubuntu-latest + container: ubuntu:20.04 install: clang-8 - toolset: clang compiler: clang++-9 cxxstd: "11,14,17" - os: ubuntu-20.04 + os: ubuntu-latest + container: ubuntu:20.04 install: clang-9 - toolset: clang compiler: clang++-10 cxxstd: "11,14,17,2a" - os: ubuntu-20.04 + os: ubuntu-latest + container: ubuntu:20.04 + install: clang-10 - toolset: clang compiler: clang++-11 cxxstd: "11,14,17,2a" - os: ubuntu-20.04 + os: ubuntu-latest + container: ubuntu:20.04 + install: clang-11 - toolset: clang compiler: clang++-12 cxxstd: "11,14,17,20" - os: ubuntu-20.04 + os: ubuntu-latest + container: ubuntu:20.04 + install: clang-12 - toolset: clang compiler: clang++-13 cxxstd: "11,14,17,20,2b" @@ -153,18 +166,24 @@ jobs: - toolset: clang compiler: clang++-19 cxxstd: "11,14,17,20,2b" - container: ubuntu:24.10 + container: ubuntu:24.04 os: ubuntu-latest install: clang-19 - toolset: clang - cxxstd: "11,14,17,20,2b" - os: macos-13 + compiler: clang++-20 + cxxstd: "11,14,17,20,23,2c" + container: ubuntu:25.04 + os: ubuntu-latest + install: clang-20 - toolset: clang cxxstd: "11,14,17,20,2b" os: macos-14 - toolset: clang cxxstd: "11,14,17,20,2b" os: macos-15 + - toolset: clang + cxxstd: "11,14,17,20,2b" + os: macos-26 runs-on: ${{matrix.os}} @@ -237,14 +256,6 @@ jobs: fail-fast: false matrix: include: - - toolset: msvc-14.0 - cxxstd: "14" - addrmd: 32,64 - os: windows-2019 - - toolset: msvc-14.2 - cxxstd: "14,17,20,latest" - addrmd: 32,64 - os: windows-2019 - toolset: msvc-14.3 cxxstd: "14,17,20,latest" addrmd: 32,64 @@ -256,7 +267,7 @@ jobs: - toolset: gcc cxxstd: "11,14,17,2a" addrmd: 64 - os: windows-2019 + os: windows-2022 runs-on: ${{matrix.os}} diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..f99ab7b --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,46 @@ +name: documentation + +on: + push: + branches: + - master + - develop + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install packages + run: | + sudo gem install asciidoctor asciidoctor-pdf rouge + + - name: Setup Boost + run: | + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + cp -r $GITHUB_WORKSPACE/* libs/exception + git submodule update --init tools/build + git submodule update --init tools/boost_install + git submodule update --init libs/config + ./bootstrap.sh + + - name: Create user-config.jam + run: | + echo "using asciidoctor ;" > ~/user-config.jam + + - name: Build documentation + run: | + cd ../boost-root/libs/exception/doc + ../../../b2 + + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@4.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: gh-pages + folder: ../boost-root/libs/exception/doc/html diff --git a/.gitignore b/.gitignore index cbe87fe..fc18f46 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /.vscode/ipch/* /.vscode/settings.json .DS_Store +doc/html/index.html diff --git a/doc/BOOST_THROW_EXCEPTION.html b/doc/BOOST_THROW_EXCEPTION.html index 2697aaf..f8da166 100644 --- a/doc/BOOST_THROW_EXCEPTION.html +++ b/doc/BOOST_THROW_EXCEPTION.html @@ -1,43 +1,10 @@ - - + +
- -Please see Boost.ThrowException.
-Redirecting to index.html#BOOST_THROW_EXCEPTION...
diff --git a/doc/Jamfile b/doc/Jamfile new file mode 100644 index 0000000..affc243 --- /dev/null +++ b/doc/Jamfile @@ -0,0 +1,20 @@ +# Copyright 2006-2026 Emil Dotchevski and Reverge Studios, Inc. +# Copyright 2017 Peter Dimov +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +project doc/exception ; +using asciidoctor ; + +html index.html : exception.adoc :NOTE: When targeting C++11 or newer and Boost 1.75 or newer is available, it is recommended to use Boost LEAF instead of Boost Exception. LEAF serves a similar purpose but it has a more elegant interface, it is more efficient, and works with or without exception handling -- yet understands Boost Exception error information for compatibility with legacy source code. This overview explains the differences between the two APIs (Boost Exception is not deprecated and will continue to be supported, including C++03 compatibility).
-The purpose of Boost Exception is to ease the design of exception class hierarchies and to help write exception handling and error reporting code.
-It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception types. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack.
-The ability to add data to exception objects after they have been passed to throw is important, because often some of the information needed to handle an exception is unavailable in the context where the failure is detected.
-Boost Exception also supports N2179-style copying of exception objects, implemented non-intrusively and automatically by the boost::throw_exception function.
-Thanks to Peter Dimov for his continuing help. Also thanks to Tobias Schwinger, Tom Brinkman, Pavel Vozenilek and everyone who participated in the review process.
-Redirecting to index.html#boost-exception...
diff --git a/doc/boost_exception_all_hpp.html b/doc/boost_exception_all_hpp.html index 55db249..370f5c7 100644 --- a/doc/boost_exception_all_hpp.html +++ b/doc/boost_exception_all_hpp.html @@ -1,60 +1,10 @@ - - + + - -#include <boost/exception/diagnostic_information.hpp>
-#include <boost/exception/error_info.hpp>
-#include <boost/exception/exception.hpp>
-#include <boost/exception/get_error_info.hpp>
-#include <boost/exception/info.hpp>
-#include <boost/exception/info_tuple.hpp>
-#include <boost/exception/errinfo_api_function.hpp>
-#include <boost/exception/errinfo_at_line.hpp>
-#include <boost/exception/errinfo_errno.hpp>
-#include <boost/exception/errinfo_file_handle.hpp>
-#include <boost/exception/errinfo_file_name.hpp>
-#include <boost/exception/errinfo_file_open_mode.hpp>
-#include <boost/exception/errinfo_type_info_name.hpp>
-#ifndef BOOST_NO_EXCEPTIONS
-#include <boost/exception/errinfo_nested_exception.hpp>
-#include <boost/exception_ptr.hpp>
-#endif
-Redirecting to index.html#boost_exception_all_hpp...
diff --git a/doc/boost_exception_current_exception_cast_hpp.html b/doc/boost_exception_current_exception_cast_hpp.html index 9ab3ac9..5b024fb 100644 --- a/doc/boost_exception_current_exception_cast_hpp.html +++ b/doc/boost_exception_current_exception_cast_hpp.html @@ -1,49 +1,10 @@ - - + + - -namespace
-boost
- {
- template <class E>
- E * current_exception_cast();
- }
-Redirecting to index.html#boost_exception_current_exception_cast_hpp...
diff --git a/doc/boost_exception_diagnostic_information_hpp.html b/doc/boost_exception_diagnostic_information_hpp.html index a3a739a..0e25bba 100644 --- a/doc/boost_exception_diagnostic_information_hpp.html +++ b/doc/boost_exception_diagnostic_information_hpp.html @@ -1,59 +1,10 @@ - - + + - -#include <string>
-
-namespace
-boost
- {
- class exception;
-
- 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 current_exception_diagnostic_information();
- }
-Redirecting to index.html#boost_exception_diagnostic_information_hpp...
diff --git a/doc/boost_exception_enable_current_exception_hpp.html b/doc/boost_exception_enable_current_exception_hpp.html index 09af9ed..f73cf91 100644 --- a/doc/boost_exception_enable_current_exception_hpp.html +++ b/doc/boost_exception_enable_current_exception_hpp.html @@ -1,51 +1,10 @@ - - + + - -#include <boost/exception/exception.hpp> - -namespace -boost - { - template <class T> - ---unspecified--- enable_current_exception( T const & e ); - }-
Redirecting to index.html#boost_exception_enable_current_exception_hpp...
diff --git a/doc/boost_exception_enable_error_info_hpp.html b/doc/boost_exception_enable_error_info_hpp.html index 3d10b30..3a8db0c 100644 --- a/doc/boost_exception_enable_error_info_hpp.html +++ b/doc/boost_exception_enable_error_info_hpp.html @@ -1,51 +1,10 @@ - - + + - -#include <boost/exception/exception.hpp> - -namespace -boost - { - template <class T> - ---unspecified--- enable_error_info( T const & x ); - }-
Redirecting to index.html#boost_exception_enable_error_info_hpp...
diff --git a/doc/boost_exception_errinfo_api_function_hpp.html b/doc/boost_exception_errinfo_api_function_hpp.html index b0c1279..e3a1ccb 100644 --- a/doc/boost_exception_errinfo_api_function_hpp.html +++ b/doc/boost_exception_errinfo_api_function_hpp.html @@ -1,50 +1,10 @@ - - + + - -#include <boost/exception/error_info.hpp> - -namespace -boost - { - typedef error_info<struct errinfo_api_function_,char const *> errinfo_api_function; - }-
Redirecting to index.html#boost_exception_errinfo_api_function_hpp...
diff --git a/doc/boost_exception_errinfo_at_line_hpp.html b/doc/boost_exception_errinfo_at_line_hpp.html index e3b2c6c..25bdcc1 100644 --- a/doc/boost_exception_errinfo_at_line_hpp.html +++ b/doc/boost_exception_errinfo_at_line_hpp.html @@ -1,50 +1,10 @@ - - + + - -#include <boost/exception/error_info.hpp> - -namespace -boost - { - typedef error_info<struct errinfo_at_line_,int> errinfo_at_line; - }-
Redirecting to index.html#boost_exception_errinfo_at_line_hpp...
diff --git a/doc/boost_exception_errinfo_errno_hpp.html b/doc/boost_exception_errinfo_errno_hpp.html index 4d2c1c4..6813630 100644 --- a/doc/boost_exception_errinfo_errno_hpp.html +++ b/doc/boost_exception_errinfo_errno_hpp.html @@ -1,51 +1,10 @@ - - + + - -#include <boost/exception/error_info.hpp> -#include <errno.h> - -namespace -boost - { - typedef error_info<struct errinfo_errno_,int> errinfo_errno; - }-
Redirecting to index.html#boost_exception_errinfo_errno_hpp...
diff --git a/doc/boost_exception_errinfo_file_handle_hpp.html b/doc/boost_exception_errinfo_file_handle_hpp.html index e1a5541..87320f1 100644 --- a/doc/boost_exception_errinfo_file_handle_hpp.html +++ b/doc/boost_exception_errinfo_file_handle_hpp.html @@ -1,51 +1,10 @@ - - + + - -#include <boost/exception/error_info.hpp> - -namespace -boost - { - template <class> class weak_ptr; - typedef error_info<struct errinfo_file_handle_,weak_ptr<FILE> > errinfo_file_handle; - }-
Redirecting to index.html#boost_exception_errinfo_file_handle_hpp...
diff --git a/doc/boost_exception_errinfo_file_name_hpp.html b/doc/boost_exception_errinfo_file_name_hpp.html index f77edef..deeb3c2 100644 --- a/doc/boost_exception_errinfo_file_name_hpp.html +++ b/doc/boost_exception_errinfo_file_name_hpp.html @@ -1,51 +1,10 @@ - - + + - -#include <boost/exception/error_info.hpp> -#include <string> - -namespace -boost - { - typedef error_info<struct errinfo_file_name_,std::string> errinfo_file_name; - }-
Redirecting to index.html#boost_exception_errinfo_file_name_hpp...
diff --git a/doc/boost_exception_errinfo_file_open_mode_hpp.html b/doc/boost_exception_errinfo_file_open_mode_hpp.html index 793a8e0..b490df9 100644 --- a/doc/boost_exception_errinfo_file_open_mode_hpp.html +++ b/doc/boost_exception_errinfo_file_open_mode_hpp.html @@ -1,51 +1,10 @@ - - + + - -#include <boost/exception/error_info.hpp> -#include <string> - -namespace -boost - { - typedef error_info<struct errinfo_file_open_mode_,std::string> errinfo_file_open_mode; - }-
Redirecting to index.html#boost_exception_errinfo_file_open_mode_hpp...
diff --git a/doc/boost_exception_errinfo_nested_exception_hpp.html b/doc/boost_exception_errinfo_nested_exception_hpp.html index 0c34163..cb4cfbe 100644 --- a/doc/boost_exception_errinfo_nested_exception_hpp.html +++ b/doc/boost_exception_errinfo_nested_exception_hpp.html @@ -1,51 +1,10 @@ - - + + - -#include <boost/exception/error_info.hpp> - -namespace -boost - { - typedef ---unspecified--- exception_ptr; - typedef error_info<struct errinfo_nested_exception_,exception_ptr> errinfo_nested_exception; - }-
Redirecting to index.html#boost_exception_errinfo_nested_exception_hpp...
diff --git a/doc/boost_exception_errinfo_type_info_name_hpp.html b/doc/boost_exception_errinfo_type_info_name_hpp.html index c3a49b2..960d6ee 100644 --- a/doc/boost_exception_errinfo_type_info_name_hpp.html +++ b/doc/boost_exception_errinfo_type_info_name_hpp.html @@ -1,51 +1,10 @@ - - + + - -#include <boost/exception/error_info.hpp> -#include <string> - -namespace -boost - { - typedef error_info<struct errinfo_type_info_name_,std::string> errinfo_type_info_name; - }-
Redirecting to index.html#boost_exception_errinfo_type_info_name_hpp...
diff --git a/doc/boost_exception_error_info_hpp.html b/doc/boost_exception_error_info_hpp.html index 19823ba..cd8af37 100644 --- a/doc/boost_exception_error_info_hpp.html +++ b/doc/boost_exception_error_info_hpp.html @@ -1,49 +1,10 @@ - - + + - -namespace
-boost
- {
- template <class Tag,class T>
- class error_info;
- }
-Redirecting to index.html#boost_exception_error_info_hpp...
diff --git a/doc/boost_exception_exception_hpp.html b/doc/boost_exception_exception_hpp.html index c9e8f81..0e052f5 100644 --- a/doc/boost_exception_exception_hpp.html +++ b/doc/boost_exception_exception_hpp.html @@ -1,63 +1,10 @@ - - + + - -namespace
-boost
- {
- class
- exception
- {
- protected:
-
- exception();
- exception( exception const & x );
- ~exception();
- };
-
- template <class Tag,class T>
- 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;
- }
-Redirecting to index.html#boost_exception_exception_hpp...
diff --git a/doc/boost_exception_get_error_info_hpp.html b/doc/boost_exception_get_error_info_hpp.html index 1850ab8..f99bb6b 100644 --- a/doc/boost_exception_get_error_info_hpp.html +++ b/doc/boost_exception_get_error_info_hpp.html @@ -1,54 +1,10 @@ - - + + - -#include <boost/shared_ptr.hpp>
-
-namespace
-boost
- {
- template <class ErrorInfo,class E>
- typename ErrorInfo::error_info::value_type const * get_error_info( E const & x );
-
- template <class ErrorInfo,class E>
- typename ErrorInfo::error_info::value_type * get_error_info( E & x );
- }
-Redirecting to index.html#boost_exception_get_error_info_hpp...
diff --git a/doc/boost_exception_info_hpp.html b/doc/boost_exception_info_hpp.html index 380f643..9bc828d 100644 --- a/doc/boost_exception_info_hpp.html +++ b/doc/boost_exception_info_hpp.html @@ -1,64 +1,10 @@ - - + + - -#include <boost/exception/exception.hpp> - -namespace -boost - { - template <class Tag,class T> - class - error_info - { - public: - - typedef T value_type; - - error_info( value_type const & v ); - value_type const & value() const; - value_type & value(); - }; - - template <class E, class Tag, class T> - E const & operator<<( E const & x, error_info<Tag,T> const & v ); - }-
Redirecting to index.html#boost_exception_info_hpp...
diff --git a/doc/boost_exception_info_tuple_hpp.html b/doc/boost_exception_info_tuple_hpp.html index 4e8c0c4..88c2aee 100644 --- a/doc/boost_exception_info_tuple_hpp.html +++ b/doc/boost_exception_info_tuple_hpp.html @@ -1,56 +1,10 @@ - - + + - -#include <boost/exception/info.hpp> -#include <boost/tuple/tuple.hpp> - -namespace -boost - { - template <class E, class Tag1, class T1, ..., class TagN, class TN> - E const & operator<<( E const & x, - tuple< - error_info<Tag1,T1>, - ..., - error_info<TagN,TN> > const & v ); - }-
Redirecting to index.html#boost_exception_info_tuple_hpp...
diff --git a/doc/boost_exception_ptr_hpp.html b/doc/boost_exception_ptr_hpp.html index f9129fa..d234064 100644 --- a/doc/boost_exception_ptr_hpp.html +++ b/doc/boost_exception_ptr_hpp.html @@ -1,67 +1,10 @@ - - + + - -#include <boost/exception/exception.hpp> - -namespace -boost - { - class - unknown_exception: - public std::exception - public boost::exception - { - ---unspecified--- - }; - - 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(); - - void rethrow_exception( exception_ptr const & ep ); - }-
Redirecting to index.html#boost_exception_ptr_hpp...
diff --git a/doc/boost_throw_exception_hpp.html b/doc/boost_throw_exception_hpp.html index 2065c46..c9b5e99 100644 --- a/doc/boost_throw_exception_hpp.html +++ b/doc/boost_throw_exception_hpp.html @@ -1,64 +1,10 @@ - - + + - -#if !defined( BOOST_EXCEPTION_DISABLE ) - #include <boost/exception/exception.hpp> - #include <boost/current_function.hpp> - #define BOOST_THROW_EXCEPTION(x)\ - ::boost::throw_exception( ::boost::enable_error_info(x) <<\ - ::boost::throw_file(__FILE__) <<\ - ::boost::throw_line((int)__LINE__) ) -#else - #define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x) -#endif - -namespace -boost - { -#ifdef BOOST_NO_EXCEPTIONS - void throw_exception( std::exception const & e ); // user defined -#else - template <class E> - void throw_exception( E const & e ); -#endif - }-
Redirecting to index.html#boost_throw_exception_hpp...
diff --git a/doc/configuration_macros.html b/doc/configuration_macros.html index 587230c..16008f3 100644 --- a/doc/configuration_macros.html +++ b/doc/configuration_macros.html @@ -1,54 +1,10 @@ - - + + - -Boost Exception responds to the following configuration macros:
-BOOST_NO_RTTI
BOOST_NO_TYPEID (both defined automatically by boost/config.hpp)
The first macro prevents Boost Exception from using dynamic_cast and dynamic typeid. If the second macro is also defined, Boost Exception does not use static typeid either. There are no observable degrading effects on the library functionality, except for the following:
--By default, the get_error_info function template can be called with any exception type. If BOOST_NO_RTTI is defined, get_error_info can be used only with objects of type boost::exception.
The library needs RTTI functionality. Disabling the language RTTI support enables an internal RTTI system, which may have more or less overhead depending on the platform.
-Note that on some non-conformant compilers, for example MSVC 7.0 and older, as well as BCC, BOOST_EXCEPTION_DISABLE is implicitly defined in boost/throw_exception.hpp.
-BOOST_NO_EXCEPTIONS (defined automatically by boost/config.hpp)
-This macro disables exception handling in Boost, forwarding all exceptions to a user-defined non-template version of boost::throw_exception. However, unless BOOST_EXCEPTION_DISABLE is also defined, users can still examine the exception object for any data added at the point of the throw, or use boost::diagnostic_information (of course under BOOST_NO_EXCEPTIONS, the user-defined boost::throw_exception is not allowed to return to the caller.)
-In addition, the following user-defined macros are recognized:
-BOOST_EXCEPTION_DISABLE (user-defined)
-By default, enable_current_exception and enable_error_info are integrated directly in the throw_exception function. Defining BOOST_EXCEPTION_DISABLE disables this integration.
-Redirecting to index.html#configuration_macros...
diff --git a/doc/copy_exception.html b/doc/copy_exception.html index 906ceed..ac692de 100644 --- a/doc/copy_exception.html +++ b/doc/copy_exception.html @@ -1,59 +1,10 @@ - - + + - -#include <boost/exception_ptr.hpp>
-namespace
-boost
- {
- template <class T>
- exception_ptr copy_exception( T const & e );
- }
-As if
-try
- {
- throw enable_current_exception(e);
- }
-catch(...)
- {
- return current_exception();
- }
-Redirecting to index.html#copy_exception...
diff --git a/doc/current_exception.html b/doc/current_exception.html index b213da9..711c861 100644 --- a/doc/current_exception.html +++ b/doc/current_exception.html @@ -1,64 +1,10 @@ - - + + - -#include <boost/exception_ptr.hpp>
-namespace
-boost
- {
- exception_ptr current_exception();
- }
-The current_exception function must not be called outside of a catch block.
-In addition, to safely copy an exception from one thread to another, if the exception object is copied by current_exception or copy_exception, the two copies must not have shared state. Exceptions that have value-type semantics (as well as the boost::exception type itself) satisfy this requirement.
-Nothing.
-Redirecting to index.html#current_exception...
diff --git a/doc/current_exception_cast.html b/doc/current_exception_cast.html index 81112a9..8718c8f 100644 --- a/doc/current_exception_cast.html +++ b/doc/current_exception_cast.html @@ -1,55 +1,10 @@ - - + + - -#include <boost/exception/current_exception_cast.hpp>
-namespace
-boost
- {
- template <class E>
- E * current_exception_cast();
- }
-This function must not be called outside of a catch block.
-A pointer of type E to the current exception object, or null if the current exception object can not be converted to E *.
-Nothing.
-Redirecting to index.html#current_exception_cast...
diff --git a/doc/current_exception_diagnostic_information.html b/doc/current_exception_diagnostic_information.html index 25b6841..ed5241f 100644 --- a/doc/current_exception_diagnostic_information.html +++ b/doc/current_exception_diagnostic_information.html @@ -1,72 +1,10 @@ - - + + - -#include <boost/exception/diagnostic_information.hpp>
namespace
-boost
- {
- std::string current_exception_diagnostic_information();
- }
-This function must not be called outside of a catch block.
-If the current exception object can be converted to boost::exception or std::exception, this function returns the same string value returned by diagnostic_information for the current exception object. Otherwise, an unspecified non-empty string is returned.
-Typical use is to call current_exception_diagnostic_information from a top-level function to output diagnostic information about unhandled exceptions:
-int
-main()
- {
- try
- {
- run_program();
- }
- catch(
- error & e )
- {
- //handle error
- }
- catch(
- ...)
- {
- std::cerr << "Unhandled exception!" << std::endl <<
- boost::current_exception_diagnostic_information();
- }
- }
-Redirecting to index.html#current_exception_diagnostic_information...
diff --git a/doc/diagnostic_information.html b/doc/diagnostic_information.html index 2805813..6020808 100644 --- a/doc/diagnostic_information.html +++ b/doc/diagnostic_information.html @@ -1,82 +1,10 @@ - - + + - -#include <boost/exception/diagnostic_information.hpp>
#include <boost/exception_ptr.hpp>
namespace
-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 );
- }
-A string value that contains varying amount of diagnostic information about the passed object:
-The string representation of each error_info object is deduced by an unqualified call to to_string(x), where x is of type error_info<Tag,T>, for which Boost Exception defines a generic overload. It converts x.value() to string, attempting to bind (at the time the error_info<Tag,T> template is instantiated) the following functions in order:
-The first successfully bound function is used at the time diagnostic_information is called; if both overload resolutions are unsuccessful, the system is unable to convert the error_info object to string, and an unspecified stub string value is used without issuing a compile error.
-The exception_ptr overload of diagnostic_information is equivalent to:
-if( p )
- try
- {
- rethrow_exception(p);
- }
- catch(...)
- {
- return current_exception_diagnostic_information(verbose);
- }
-else return <unspecified-string-value>;
-this is a possible output from the diagnostic_information function, as used in libs/exception/example/example_io.cpp:
-example_io.cpp(70): Throw in function class boost::shared_ptr<struct _iobuf> __cdecl my_fopen(const char *,const char *) -Dynamic exception type: class boost::exception_detail::clone_impl<struct fopen_error> -std::exception::what: example_io error -[struct boost::errinfo_api_function_ *] = fopen -[struct boost::errinfo_errno_ *] = 2, "No such file or directory" -[struct boost::errinfo_file_name_ *] = tmp1.txt -[struct boost::errinfo_file_open_mode_ *] = rb-
Redirecting to index.html#diagnostic_information...
diff --git a/doc/diagnostic_information_what.html b/doc/diagnostic_information_what.html index 3ed8979..28562c1 100644 --- a/doc/diagnostic_information_what.html +++ b/doc/diagnostic_information_what.html @@ -1,55 +1,10 @@ - - + + - -#include <boost/exception/diagnostic_information.hpp>
namespace
-boost
- {
- char const * diagnostic_information_what( boost::exception const & e, bool verbose=true ) throw();
- }
-The diagnostic_information_what function is intended to be called from a user-defined std::exception::what() override. This allows diagnostic information to be returned as the what() string.
-A pointer to a zero-terminated buffer that contains a string similar to the std::string returned by the diagnostic_information function, or null to indicate a failure.
-Nothing.
-The returned pointer becomes invalid if any error_info is modified or added to the exception object, or if another diagnostic information function is called.
-Redirecting to index.html#diagnostic_information_what...
diff --git a/doc/docinfo.html b/doc/docinfo.html new file mode 100644 index 0000000..5e64c36 --- /dev/null +++ b/doc/docinfo.html @@ -0,0 +1,12 @@ + + + + diff --git a/doc/enable_current_exception.html b/doc/enable_current_exception.html index eb3951e..9a40de5 100644 --- a/doc/enable_current_exception.html +++ b/doc/enable_current_exception.html @@ -1,68 +1,10 @@ - - + + - -#include <boost/exception/enable_current_exception.hpp>
-namespace
-boost
- {
- template <class T>
- ---unspecified--- enable_current_exception( T const & e );
- }
-An object of unspecified type which derives publicly from T. That is, the returned object can be intercepted by a catch(T &).
-This function is designed to be used directly in a throw-expression to enable the exception_ptr support in Boost Exception. For example:
-class
-my_exception:
- public std::exception
- {
- };
-
-....
-throw boost::enable_current_exception(my_exception());
-Unless enable_current_exception is called at the time an exception object is used in a throw-expression, an attempt to copy it using current_exception may return an exception_ptr which refers to an instance of unknown_exception. See current_exception for details.
-Instead of using the throw keyword directly, it is preferable to call boost::throw_exception. This is guaranteed to throw an exception that derives from boost::exception and supports the exception_ptr functionality.
-Redirecting to index.html#enable_current_exception...
diff --git a/doc/enable_error_info.html b/doc/enable_error_info.html index 9a0a4ab..11a7cb6 100644 --- a/doc/enable_error_info.html +++ b/doc/enable_error_info.html @@ -1,57 +1,10 @@ - - + + - -#include <boost/exception/enable_error_info.hpp>
-namespace
-boost
- {
- template <class T>
- ---unspecified--- enable_error_info( T const & x );
- }
-T must be a class with an accessible no-throw copy constructor as per (15.5.1).
-Nothing.
-Redirecting to index.html#enable_error_info...
diff --git a/doc/errinfo_api_function.html b/doc/errinfo_api_function.html index 314d364..3a5c201 100644 --- a/doc/errinfo_api_function.html +++ b/doc/errinfo_api_function.html @@ -1,97 +1,10 @@ - - + + - -#include <boost/exception/errinfo_api_function.hpp>
-#include <boost/exception/error_info.hpp> - -namespace -boost - { - typedef error_info<struct errinfo_api_function_,char const *> errinfo_api_function; - }-
This type is designed to be used as a standard error_info instance for transporting the name of a relevant API function (which does not use exceptions to report errors) in exceptions deriving from boost::exception.
-#include <boost/exception/errinfo_api_function.hpp> -#include <boost/exception/errinfo_at_line.hpp> -#include <boost/exception/errinfo_errno.hpp> -#include <boost/exception/errinfo_file_handle.hpp> -#include <boost/exception/errinfo_file_name.hpp> -#include <boost/exception/errinfo_file_open_mode.hpp> -#include <boost/exception/info.hpp> -#include <boost/throw_exception.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/weak_ptr.hpp> -#include <stdio.h> -#include <errno.h> -#include <exception> - -struct error : virtual std::exception, virtual boost::exception { }; -struct file_error : virtual error { }; -struct file_open_error: virtual file_error { }; -struct file_read_error: virtual file_error { }; - -boost::shared_ptr<FILE> -open_file( char const * file, char const * mode ) - { - if( FILE * f=fopen(file,mode) ) - return boost::shared_ptr<FILE>(f,fclose); - else - BOOST_THROW_EXCEPTION( - file_open_error() << - boost::errinfo_api_function("fopen") << - boost::errinfo_errno(errno) << - boost::errinfo_file_name(file) << - boost::errinfo_file_open_mode(mode) ); - } - -size_t -read_file( boost::shared_ptr<FILE> const & f, void * buf, size_t size ) - { - size_t nr=fread(buf,1,size,f.get()); - if( ferror(f.get()) ) - BOOST_THROW_EXCEPTION( - file_read_error() << - boost::errinfo_api_function("fread") << - boost::errinfo_errno(errno) << - boost::errinfo_file_handle(f) ); - return nr; - }-
Redirecting to index.html#errinfo_api_function...
diff --git a/doc/errinfo_at_line.html b/doc/errinfo_at_line.html index 12da454..cad206c 100644 --- a/doc/errinfo_at_line.html +++ b/doc/errinfo_at_line.html @@ -1,97 +1,10 @@ - - + + - -#include <boost/exception/errinfo_at_line.hpp>
-#include <boost/exception/error_info.hpp> - -namespace -boost - { - typedef error_info<struct errinfo_at_line_,int> errinfo_at_line; - }-
This type is designed to be used as a standard error_info instance for transporting a relevant text file line number, for example in parse error exceptions deriving from boost::exception.
-#include <boost/exception/errinfo_api_function.hpp> -#include <boost/exception/errinfo_at_line.hpp> -#include <boost/exception/errinfo_errno.hpp> -#include <boost/exception/errinfo_file_handle.hpp> -#include <boost/exception/errinfo_file_name.hpp> -#include <boost/exception/errinfo_file_open_mode.hpp> -#include <boost/exception/info.hpp> -#include <boost/throw_exception.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/weak_ptr.hpp> -#include <stdio.h> -#include <errno.h> -#include <exception> - -struct error : virtual std::exception, virtual boost::exception { }; -struct file_error : virtual error { }; -struct file_open_error: virtual file_error { }; -struct file_read_error: virtual file_error { }; - -boost::shared_ptr<FILE> -open_file( char const * file, char const * mode ) - { - if( FILE * f=fopen(file,mode) ) - return boost::shared_ptr<FILE>(f,fclose); - else - BOOST_THROW_EXCEPTION( - file_open_error() << - boost::errinfo_api_function("fopen") << - boost::errinfo_errno(errno) << - boost::errinfo_file_name(file) << - boost::errinfo_file_open_mode(mode) ); - } - -size_t -read_file( boost::shared_ptr<FILE> const & f, void * buf, size_t size ) - { - size_t nr=fread(buf,1,size,f.get()); - if( ferror(f.get()) ) - BOOST_THROW_EXCEPTION( - file_read_error() << - boost::errinfo_api_function("fread") << - boost::errinfo_errno(errno) << - boost::errinfo_file_handle(f) ); - return nr; - }-
Redirecting to index.html#errinfo_at_line...
diff --git a/doc/errinfo_errno.html b/doc/errinfo_errno.html index 245aea7..cba87a7 100644 --- a/doc/errinfo_errno.html +++ b/doc/errinfo_errno.html @@ -1,98 +1,10 @@ - - + + - -#include <boost/exception/errinfo_errno.hpp>
-#include <boost/exception/error_info.hpp> -#include <errno.h> - -namespace -boost - { - typedef error_info<struct errinfo_errno_,int> errinfo_errno; - }-
This type is designed to be used as a standard error_info instance for transporting a relevant errno value in exceptions deriving from boost::exception.
-#include <boost/exception/errinfo_api_function.hpp> -#include <boost/exception/errinfo_at_line.hpp> -#include <boost/exception/errinfo_errno.hpp> -#include <boost/exception/errinfo_file_handle.hpp> -#include <boost/exception/errinfo_file_name.hpp> -#include <boost/exception/errinfo_file_open_mode.hpp> -#include <boost/exception/info.hpp> -#include <boost/throw_exception.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/weak_ptr.hpp> -#include <stdio.h> -#include <errno.h> -#include <exception> - -struct error : virtual std::exception, virtual boost::exception { }; -struct file_error : virtual error { }; -struct file_open_error: virtual file_error { }; -struct file_read_error: virtual file_error { }; - -boost::shared_ptr<FILE> -open_file( char const * file, char const * mode ) - { - if( FILE * f=fopen(file,mode) ) - return boost::shared_ptr<FILE>(f,fclose); - else - BOOST_THROW_EXCEPTION( - file_open_error() << - boost::errinfo_api_function("fopen") << - boost::errinfo_errno(errno) << - boost::errinfo_file_name(file) << - boost::errinfo_file_open_mode(mode) ); - } - -size_t -read_file( boost::shared_ptr<FILE> const & f, void * buf, size_t size ) - { - size_t nr=fread(buf,1,size,f.get()); - if( ferror(f.get()) ) - BOOST_THROW_EXCEPTION( - file_read_error() << - boost::errinfo_api_function("fread") << - boost::errinfo_errno(errno) << - boost::errinfo_file_handle(f) ); - return nr; - }-
Redirecting to index.html#errinfo_errno...
diff --git a/doc/errinfo_file_handle.html b/doc/errinfo_file_handle.html index 6d48c87..14d6380 100644 --- a/doc/errinfo_file_handle.html +++ b/doc/errinfo_file_handle.html @@ -1,98 +1,10 @@ - - + + - -#include <boost/exception/errinfo_file_handle.hpp>
-#include <boost/exception/error_info.hpp> - -namespace -boost - { - template <class> class weak_ptr; - typedef error_info<struct errinfo_file_handle_,weak_ptr<FILE> > errinfo_file_handle; - }-
This type is designed to be used as a standard error_info instance for transporting a relevant FILE pointer managed by a boost::shared_ptr<FILE> in exceptions deriving from boost::exception.
-#include <boost/exception/errinfo_api_function.hpp> -#include <boost/exception/errinfo_at_line.hpp> -#include <boost/exception/errinfo_errno.hpp> -#include <boost/exception/errinfo_file_handle.hpp> -#include <boost/exception/errinfo_file_name.hpp> -#include <boost/exception/errinfo_file_open_mode.hpp> -#include <boost/exception/info.hpp> -#include <boost/throw_exception.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/weak_ptr.hpp> -#include <stdio.h> -#include <errno.h> -#include <exception> - -struct error : virtual std::exception, virtual boost::exception { }; -struct file_error : virtual error { }; -struct file_open_error: virtual file_error { }; -struct file_read_error: virtual file_error { }; - -boost::shared_ptr<FILE> -open_file( char const * file, char const * mode ) - { - if( FILE * f=fopen(file,mode) ) - return boost::shared_ptr<FILE>(f,fclose); - else - BOOST_THROW_EXCEPTION( - file_open_error() << - boost::errinfo_api_function("fopen") << - boost::errinfo_errno(errno) << - boost::errinfo_file_name(file) << - boost::errinfo_file_open_mode(mode) ); - } - -size_t -read_file( boost::shared_ptr<FILE> const & f, void * buf, size_t size ) - { - size_t nr=fread(buf,1,size,f.get()); - if( ferror(f.get()) ) - BOOST_THROW_EXCEPTION( - file_read_error() << - boost::errinfo_api_function("fread") << - boost::errinfo_errno(errno) << - boost::errinfo_file_handle(f) ); - return nr; - }-
Redirecting to index.html#errinfo_file_handle...
diff --git a/doc/errinfo_file_name.html b/doc/errinfo_file_name.html index 33cd0cc..ff3a11e 100644 --- a/doc/errinfo_file_name.html +++ b/doc/errinfo_file_name.html @@ -1,98 +1,10 @@ - - + + - -#include <boost/exception/errinfo_file_name.hpp>
-#include <boost/exception/error_info.hpp> -#include <string> - -namespace -boost - { - typedef error_info<struct errinfo_file_name_,std::string> errinfo_file_name; - }-
This type is designed to be used as a standard error_info instance for transporting a relevant file name in exceptions deriving from boost::exception.
-#include <boost/exception/errinfo_api_function.hpp> -#include <boost/exception/errinfo_at_line.hpp> -#include <boost/exception/errinfo_errno.hpp> -#include <boost/exception/errinfo_file_handle.hpp> -#include <boost/exception/errinfo_file_name.hpp> -#include <boost/exception/errinfo_file_open_mode.hpp> -#include <boost/exception/info.hpp> -#include <boost/throw_exception.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/weak_ptr.hpp> -#include <stdio.h> -#include <errno.h> -#include <exception> - -struct error : virtual std::exception, virtual boost::exception { }; -struct file_error : virtual error { }; -struct file_open_error: virtual file_error { }; -struct file_read_error: virtual file_error { }; - -boost::shared_ptr<FILE> -open_file( char const * file, char const * mode ) - { - if( FILE * f=fopen(file,mode) ) - return boost::shared_ptr<FILE>(f,fclose); - else - BOOST_THROW_EXCEPTION( - file_open_error() << - boost::errinfo_api_function("fopen") << - boost::errinfo_errno(errno) << - boost::errinfo_file_name(file) << - boost::errinfo_file_open_mode(mode) ); - } - -size_t -read_file( boost::shared_ptr<FILE> const & f, void * buf, size_t size ) - { - size_t nr=fread(buf,1,size,f.get()); - if( ferror(f.get()) ) - BOOST_THROW_EXCEPTION( - file_read_error() << - boost::errinfo_api_function("fread") << - boost::errinfo_errno(errno) << - boost::errinfo_file_handle(f) ); - return nr; - }-
Redirecting to index.html#errinfo_file_name...
diff --git a/doc/errinfo_file_open_mode.html b/doc/errinfo_file_open_mode.html index 4de6cce..132c682 100644 --- a/doc/errinfo_file_open_mode.html +++ b/doc/errinfo_file_open_mode.html @@ -1,98 +1,10 @@ - - + + - -#include <boost/exception/errinfo_file_open_mode.hpp>
-#include <boost/exception/error_info.hpp> -#include <string> - -namespace -boost - { - typedef error_info<struct errinfo_file_open_mode_,std::string> errinfo_file_open_mode; - }-
This type is designed to be used as a standard error_info instance for transporting the string passed as a second argument to fopen in exceptions indicating fopen failures and deriving from boost::exception.
-#include <boost/exception/errinfo_api_function.hpp> -#include <boost/exception/errinfo_at_line.hpp> -#include <boost/exception/errinfo_errno.hpp> -#include <boost/exception/errinfo_file_handle.hpp> -#include <boost/exception/errinfo_file_name.hpp> -#include <boost/exception/errinfo_file_open_mode.hpp> -#include <boost/exception/info.hpp> -#include <boost/throw_exception.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/weak_ptr.hpp> -#include <stdio.h> -#include <errno.h> -#include <exception> - -struct error : virtual std::exception, virtual boost::exception { }; -struct file_error : virtual error { }; -struct file_open_error: virtual file_error { }; -struct file_read_error: virtual file_error { }; - -boost::shared_ptr<FILE> -open_file( char const * file, char const * mode ) - { - if( FILE * f=fopen(file,mode) ) - return boost::shared_ptr<FILE>(f,fclose); - else - BOOST_THROW_EXCEPTION( - file_open_error() << - boost::errinfo_api_function("fopen") << - boost::errinfo_errno(errno) << - boost::errinfo_file_name(file) << - boost::errinfo_file_open_mode(mode) ); - } - -size_t -read_file( boost::shared_ptr<FILE> const & f, void * buf, size_t size ) - { - size_t nr=fread(buf,1,size,f.get()); - if( ferror(f.get()) ) - BOOST_THROW_EXCEPTION( - file_read_error() << - boost::errinfo_api_function("fread") << - boost::errinfo_errno(errno) << - boost::errinfo_file_handle(f) ); - return nr; - }-
Redirecting to index.html#errinfo_file_open_mode...
diff --git a/doc/errinfo_nested_exception.html b/doc/errinfo_nested_exception.html index 6a4ec8b..2134950 100644 --- a/doc/errinfo_nested_exception.html +++ b/doc/errinfo_nested_exception.html @@ -1,52 +1,10 @@ - - + + - -#include <boost/exception/errinfo_nested_exception.hpp>
-#include <boost/exception/error_info.hpp> - -namespace -boost - { - typedef ---unspecified--- exception_ptr; - typedef error_info<struct errinfo_nested_exception_,exception_ptr> errinfo_nested_exception; - }-
This type is designed to be used as a standard error_info instance for transporting (in exceptions deriving from boost::exception) an exception_ptr to an exception nested into another exception.
-Redirecting to index.html#errinfo_nested_exception...
diff --git a/doc/errinfo_type_info_name.html b/doc/errinfo_type_info_name.html index 21287ec..530ee30 100644 --- a/doc/errinfo_type_info_name.html +++ b/doc/errinfo_type_info_name.html @@ -1,52 +1,10 @@ - - + + - -#include <boost/exception/errinfo_type_info_name.hpp>
-#include <boost/exception/error_info.hpp> -#include <string> - -namespace -boost - { - typedef error_info<struct errinfo_type_info_name_,std::string> errinfo_type_info_name; - }-
This type is designed to be used as a standard error_info instance for transporting strings returned by std::type_info::name in exceptions deriving from boost::exception objects.
-Redirecting to index.html#errinfo_type_info_name...
diff --git a/doc/error_info.html b/doc/error_info.html index cc598b7..dc55c71 100644 --- a/doc/error_info.html +++ b/doc/error_info.html @@ -1,90 +1,10 @@ - - + + - -#include <boost/exception/info.hpp>
-namespace
-boost
- {
- template <class Tag,class T>
- class
- error_info
- {
- public:
-
- typedef T value_type;
-
- error_info( value_type const & v );
- value_type const & value() const;
- value_type & value();
- };
- }
-T must have accessible copy constructor and must not be a reference (there is no requirement that T's copy constructor does not throw.)
-This class template is used to associate a Tag type with a value type T. Objects of type error_info<Tag,T> can be passed to operator<< to be stored in objects of type boost::exception.
-The header <boost/exception/error_info.hpp> provides a declaration of the error_info template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, for example:
-#include <boost/exception/error_info.hpp> - -struct tag_errno; -typedef boost::error_info<tag_errno,int> errno_info;-
Or, the shorter equivalent:
-#include <boost/exception/error_info.hpp> - -typedef boost::error_info<struct tag_errno,int> errno_info;-
This errno_info typedef can be passed to operator<< (#include <boost/exception/info.hpp> first) to store an int named tag_errno in exceptions of types that derive from boost::exception:
-throw file_read_error() << errno_info(errno);
-It can also be passed to get_error_info (#include <boost/exception/get_error_info.hpp> first) to retrieve the tag_errno int from a boost::exception:
-catch( boost::exception & x ) - { - if( int const * e=boost::get_error_info<errno_info>(x) ) - .... - }-
For convenience and uniformity, Boost Exception defines the following commonly used error_info typedefs, ready for use with operator<<:
- -Redirecting to index.html#error_info...
diff --git a/doc/error_info_error_info.html b/doc/error_info_error_info.html index 5efe9e2..c6f05e9 100644 --- a/doc/error_info_error_info.html +++ b/doc/error_info_error_info.html @@ -1,48 +1,10 @@ - - + + - -#include <boost/exception/info.hpp>
-error_info( value_type const & v );
-Stores a copy of v in the error_info object.
-Any exception emitted by v's copy constructor.
-Redirecting to index.html#error_info_error_info...
diff --git a/doc/error_info_value.html b/doc/error_info_value.html index ba7179c..6303cc0 100644 --- a/doc/error_info_value.html +++ b/doc/error_info_value.html @@ -1,49 +1,10 @@ - - + + - -#include <boost/exception/info.hpp>
-value_type const & value() const;
-value_type & value();
-Returns a (const) reference to the copy of the value passed to error_info's constructor stored in the error_info object.
-Nothing.
-Redirecting to index.html#error_info_value...
diff --git a/doc/error_info_value_type.html b/doc/error_info_value_type.html index 73fbe5b..49e6760 100644 --- a/doc/error_info_value_type.html +++ b/doc/error_info_value_type.html @@ -1,46 +1,10 @@ - - + + - -#include <boost/exception/info.hpp>
-typedef T value_type;
-The expression error_info<Tag,T>::value_type evaluates to T.
-Redirecting to index.html#error_info_value_type...
diff --git a/doc/exception-theme.yml b/doc/exception-theme.yml new file mode 100644 index 0000000..6128b38 --- /dev/null +++ b/doc/exception-theme.yml @@ -0,0 +1,28 @@ +extends: default +base: + font: + color: #404040 +literal: + font: + family: Courier + color: #000000 +admonition: + icon: + note: + stroke-color: #000000 + tip: + stroke-color: #000000 + warning: + stroke-color: #FF5100 + important: + stroke-color: #FF5100 + caution: + stroke-color: #FF5100 +conum: + font: + glyphs: circled + color: #000000 +link: + text-decoration: underline + text-decoration-width: 0.5 + font-color: #000000 diff --git a/doc/exception.adoc b/doc/exception.adoc new file mode 100644 index 0000000..08e26ba --- /dev/null +++ b/doc/exception.adoc @@ -0,0 +1,2055 @@ +// Copyright 2006-2026 Emil Dotchevski and Reverge Studios, Inc. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +:last-update-label!: +:icons: font +:prewrap!: +:docinfo: shared +:stylesheet: zajo-dark.css +:source-highlighter: rouge + +ifdef::backend-pdf[] += Boost Exception +endif::[] +ifndef::backend-pdf[] += Boost Exceptionpass:[] +endif::[] +{CPP} Exception Augmentation Library | Emil Dotchevski +ifndef::backend-pdf[] +:toc: left +:toclevels: 3 +:toc-title: +endif::[] + +[[boost-exception]] + +[cols="25,>75", grid=none, frame=none] +|=== +| +|For {CPP}11 or newer, consider using https://www.boost.org/doc/libs/release/libs/leaf/doc/html/index.html[Boost LEAF]. It provides similar functionality more efficiently and understands Boost Exception for compatibility; see https://www.boost.org/doc/libs/release/libs/leaf/doc/html/index.html#boost_exception[this overview]. +|=== + +== Introduction + +The purpose of Boost Exception is to ease the design of exception class hierarchies and to help write exception handling and error reporting code. + +It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception types. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack. + +The ability to add data to exception objects after they have been passed to throw is important, because often some of the information needed to handle an exception is unavailable in the context where the failure is detected. + +Boost Exception also supports http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html[N2179]-style <