From 0f5a51238bc9fac3a7746b9051c4d87c34db6040 Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Wed, 22 Jul 2009 20:55:50 +0000 Subject: [PATCH] Merging in changes trunk updates: adding standard error_info typedefs, updating the documentation. [SVN r55094] --- doc/boost_exception_all_hpp.html | 64 + ..._exception_diagnostic_information_hpp.html | 2 +- ...st_exception_errinfo_api_function_hpp.html | 55 + doc/boost_exception_errinfo_at_line_hpp.html | 55 + doc/boost_exception_errinfo_errno_hpp.html | 56 + ...ost_exception_errinfo_file_handle_hpp.html | 56 + ...boost_exception_errinfo_file_name_hpp.html | 56 + ..._exception_errinfo_file_open_mode_hpp.html | 56 + ..._exception_errinfo_type_info_name_hpp.html | 56 + doc/boost_exception_error_info_hpp.html | 9 +- doc/boost_exception_exception_hpp.html | 8 +- doc/boost_exception_get_error_info_hpp.html | 2 +- doc/boost_exception_hpp.html | 18 +- doc/boost_exception_info_hpp.html | 2 +- doc/boost_exception_info_tuple_hpp.html | 2 +- doc/boost_exception_ptr_hpp.html | 2 +- doc/diagnostic_information.html | 12 +- doc/errinfo_api_function.html | 102 + doc/errinfo_at_line.html | 101 + doc/errinfo_errno.html | 103 + doc/errinfo_file_handle.html | 102 + doc/errinfo_file_name.html | 103 + doc/errinfo_file_open_mode.html | 103 + doc/errinfo_type_info_name.html | 56 + doc/error_info.html | 9 + doc/exception.html | 7 + doc/frequently_asked_questions.html | 12 +- doc/headers.html | 9 +- doc/page_idx.html | 16 +- doc/source/boost-exception.reno | 20566 +++++++++------- doc/synopsis.html | 78 +- doc/tutorial_diagnostic_information.html | 14 +- doc/tutorial_enable_error_info.html | 2 +- doc/tutorial_exception_ptr.html | 7 +- doc/tutorial_transporting_data.html | 47 +- doc/types.html | 7 + example/Jamfile | 1 + example/cloning_1.cpp | 7 +- example/enable_error_info.cpp | 2 +- example/errinfos.cpp | 53 + example/error_info_1.cpp | 13 +- example/error_info_2.cpp | 12 +- example/example_io.cpp | 102 +- example/info_tuple.cpp | 16 +- example/logging.cpp | 4 +- include/boost/exception/all.hpp | 26 + .../boost/exception/errinfo_api_function.hpp | 22 + include/boost/exception/errinfo_at_line.hpp | 18 + include/boost/exception/errinfo_errno.hpp | 35 + .../boost/exception/errinfo_file_handle.hpp | 20 + include/boost/exception/errinfo_file_name.hpp | 26 + .../exception/errinfo_file_open_mode.hpp | 26 + .../exception/errinfo_type_info_name.hpp | 23 + include/boost/exception/exception.hpp | 12 +- test/Jamfile.v2 | 9 + test/all_hpp_test.cpp | 7 + test/errinfo_api_function_hpp_test.cpp | 7 + test/errinfo_at_line_hpp_test.cpp | 7 + test/errinfo_errno_hpp_test.cpp | 7 + test/errinfo_file_handle_hpp_test.cpp | 7 + test/errinfo_file_name_hpp_test.cpp | 7 + test/errinfo_file_open_mode_hpp_test.cpp | 7 + test/errinfo_type_info_name_hpp_test.cpp | 7 + test/errinfos_test.cpp | 61 + 64 files changed, 13772 insertions(+), 8727 deletions(-) create mode 100644 doc/boost_exception_all_hpp.html create mode 100644 doc/boost_exception_errinfo_api_function_hpp.html create mode 100644 doc/boost_exception_errinfo_at_line_hpp.html create mode 100644 doc/boost_exception_errinfo_errno_hpp.html create mode 100644 doc/boost_exception_errinfo_file_handle_hpp.html create mode 100644 doc/boost_exception_errinfo_file_name_hpp.html create mode 100644 doc/boost_exception_errinfo_file_open_mode_hpp.html create mode 100644 doc/boost_exception_errinfo_type_info_name_hpp.html create mode 100644 doc/errinfo_api_function.html create mode 100644 doc/errinfo_at_line.html create mode 100644 doc/errinfo_errno.html create mode 100644 doc/errinfo_file_handle.html create mode 100644 doc/errinfo_file_name.html create mode 100644 doc/errinfo_file_open_mode.html create mode 100644 doc/errinfo_type_info_name.html create mode 100644 example/errinfos.cpp create mode 100644 include/boost/exception/all.hpp create mode 100644 include/boost/exception/errinfo_api_function.hpp create mode 100644 include/boost/exception/errinfo_at_line.hpp create mode 100644 include/boost/exception/errinfo_errno.hpp create mode 100644 include/boost/exception/errinfo_file_handle.hpp create mode 100644 include/boost/exception/errinfo_file_name.hpp create mode 100644 include/boost/exception/errinfo_file_open_mode.hpp create mode 100644 include/boost/exception/errinfo_type_info_name.hpp create mode 100644 test/all_hpp_test.cpp create mode 100644 test/errinfo_api_function_hpp_test.cpp create mode 100644 test/errinfo_at_line_hpp_test.cpp create mode 100644 test/errinfo_errno_hpp_test.cpp create mode 100644 test/errinfo_file_handle_hpp_test.cpp create mode 100644 test/errinfo_file_name_hpp_test.cpp create mode 100644 test/errinfo_file_open_mode_hpp_test.cpp create mode 100644 test/errinfo_type_info_name_hpp_test.cpp create mode 100644 test/errinfos_test.cpp diff --git a/doc/boost_exception_all_hpp.html b/doc/boost_exception_all_hpp.html new file mode 100644 index 0000000..0e932d4 --- /dev/null +++ b/doc/boost_exception_all_hpp.html @@ -0,0 +1,64 @@ + + + + + boost/exception/all.hpp + + + +
+ +
+ + diff --git a/doc/boost_exception_diagnostic_information_hpp.html b/doc/boost_exception_diagnostic_information_hpp.html index ad550d4..e0761eb 100644 --- a/doc/boost_exception_diagnostic_information_hpp.html +++ b/doc/boost_exception_diagnostic_information_hpp.html @@ -38,7 +38,7 @@ boost }

See Also:

-
boost/exception.hpp
+
boost/exception/all.hpp
current_exception_diagnostic_information
diagnostic_information
Synopsis
diff --git a/doc/boost_exception_errinfo_api_function_hpp.html b/doc/boost_exception_errinfo_api_function_hpp.html new file mode 100644 index 0000000..55b42b9 --- /dev/null +++ b/doc/boost_exception_errinfo_api_function_hpp.html @@ -0,0 +1,55 @@ + + + + + boost/exception/errinfo_api_function.hpp + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

boost/exception/errinfo_api_function.hpp

+
+

Synopsis

+
#include <boost/exception/error_info.hpp>
+
+namespace
+boost
+    {
+    typedef error_info<struct errinfo_api_function_,int> errinfo_api_function;
+    }
+
+ + + + +
+
+
+ + diff --git a/doc/boost_exception_errinfo_at_line_hpp.html b/doc/boost_exception_errinfo_at_line_hpp.html new file mode 100644 index 0000000..2145da9 --- /dev/null +++ b/doc/boost_exception_errinfo_at_line_hpp.html @@ -0,0 +1,55 @@ + + + + + boost/exception/errinfo_at_line.hpp + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

boost/exception/errinfo_at_line.hpp

+
+

Synopsis

+
#include <boost/exception/error_info.hpp>
+
+namespace
+boost
+    {
+    typedef error_info<struct errinfo_at_line_,int> errinfo_at_line;
+    }
+
+ + + + +
+
+
+ + diff --git a/doc/boost_exception_errinfo_errno_hpp.html b/doc/boost_exception_errinfo_errno_hpp.html new file mode 100644 index 0000000..bb1277a --- /dev/null +++ b/doc/boost_exception_errinfo_errno_hpp.html @@ -0,0 +1,56 @@ + + + + + boost/exception/errinfo_errno.hpp + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

boost/exception/errinfo_errno.hpp

+
+

Synopsis

+
#include <boost/exception/error_info.hpp>
+#include <errno.h>
+
+namespace
+boost
+    {
+    typedef error_info<struct errinfo_errno_,int> errinfo_errno;
+    }
+
+ + + + +
+
+
+ + diff --git a/doc/boost_exception_errinfo_file_handle_hpp.html b/doc/boost_exception_errinfo_file_handle_hpp.html new file mode 100644 index 0000000..371ea70 --- /dev/null +++ b/doc/boost_exception_errinfo_file_handle_hpp.html @@ -0,0 +1,56 @@ + + + + + boost/exception/errinfo_file_handle.hpp + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

boost/exception/errinfo_file_handle.hpp

+
+

Synopsis

+
#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;
+    }
+
+ + + + +
+
+
+ + diff --git a/doc/boost_exception_errinfo_file_name_hpp.html b/doc/boost_exception_errinfo_file_name_hpp.html new file mode 100644 index 0000000..d53dfcb --- /dev/null +++ b/doc/boost_exception_errinfo_file_name_hpp.html @@ -0,0 +1,56 @@ + + + + + boost/exception/errinfo_file_name.hpp + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

boost/exception/errinfo_file_name.hpp

+
+

Synopsis

+
#include <boost/exception/error_info.hpp>
+#include <string>
+
+namespace
+boost
+    {
+    typedef error_info<struct errinfo_file_name_,std::string> errinfo_file_name;
+    }
+
+ + + + +
+
+
+ + diff --git a/doc/boost_exception_errinfo_file_open_mode_hpp.html b/doc/boost_exception_errinfo_file_open_mode_hpp.html new file mode 100644 index 0000000..126ba94 --- /dev/null +++ b/doc/boost_exception_errinfo_file_open_mode_hpp.html @@ -0,0 +1,56 @@ + + + + + boost/exception/errinfo_file_open_mode.hpp + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

boost/exception/errinfo_file_open_mode.hpp

+
+

Synopsis

+
#include <boost/exception/error_info.hpp>
+#include <string>
+
+namespace
+boost
+    {
+    typedef error_info<struct errinfo_file_open_mode_,std::string> errinfo_file_open_mode;
+    }
+
+ + + + +
+
+
+ + diff --git a/doc/boost_exception_errinfo_type_info_name_hpp.html b/doc/boost_exception_errinfo_type_info_name_hpp.html new file mode 100644 index 0000000..16a8132 --- /dev/null +++ b/doc/boost_exception_errinfo_type_info_name_hpp.html @@ -0,0 +1,56 @@ + + + + + boost/exception/errinfo_type_info_name.hpp + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

boost/exception/errinfo_type_info_name.hpp

+
+

Synopsis

+
#include <boost/exception/error_info.hpp>
+#include <string>
+
+namespace
+boost
+    {
+    typedef error_info<struct errinfo_type_info_name_,std::string> errinfo_type_info_name;
+    }
+
+ + + + +
+
+
+ + diff --git a/doc/boost_exception_error_info_hpp.html b/doc/boost_exception_error_info_hpp.html index d0c1a54..fe6cd10 100644 --- a/doc/boost_exception_error_info_hpp.html +++ b/doc/boost_exception_error_info_hpp.html @@ -30,7 +30,14 @@ boost }

See Also:

-
boost/exception.hpp
+
diff --git a/doc/boost_exception_exception_hpp.html b/doc/boost_exception_exception_hpp.html index fbd123f..fdf1873 100644 --- a/doc/boost_exception_exception_hpp.html +++ b/doc/boost_exception_exception_hpp.html @@ -38,14 +38,14 @@ boost template <class Tag,class T> class error_info; - typedef error_info<struct tag_throw_function,char const *> throw_function; - typedef error_info<struct tag_throw_file,char const *> throw_file; - typedef error_info<struct tag_throw_line,int> throw_line; + 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; }

See Also:

-
diff --git a/doc/boost_exception_hpp.html b/doc/boost_exception_hpp.html index 49acadc..918ce03 100644 --- a/doc/boost_exception_hpp.html +++ b/doc/boost_exception_hpp.html @@ -21,21 +21,9 @@ +

This header has been deprecated.

+

Please #include <boost/exception/all.hpp> instead.

+
diff --git a/doc/boost_exception_info_hpp.html b/doc/boost_exception_info_hpp.html index 49141bc..275c420 100644 --- a/doc/boost_exception_info_hpp.html +++ b/doc/boost_exception_info_hpp.html @@ -44,7 +44,7 @@ boost }

See Also:

-

See Also:

-
boost/exception.hpp
+
diff --git a/doc/boost_exception_ptr_hpp.html b/doc/boost_exception_ptr_hpp.html index 8c63f06..0b132f5 100644 --- a/doc/boost_exception_ptr_hpp.html +++ b/doc/boost_exception_ptr_hpp.html @@ -48,7 +48,7 @@ boost }

See Also:

-

See Also:

BOOST_THROW_EXCEPTION
diff --git a/doc/errinfo_api_function.html b/doc/errinfo_api_function.html new file mode 100644 index 0000000..5071481 --- /dev/null +++ b/doc/errinfo_api_function.html @@ -0,0 +1,102 @@ + + + + + errinfo_api_function + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

errinfo_api_function

+
+

#include <boost/exception/errinfo_api_function.hpp>

+
#include <boost/exception/error_info.hpp>
+
+namespace
+boost
+    {
+    typedef error_info<struct errinfo_api_function_,int> 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.

+

Example:

+
#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;
+    }
+
+ + + + +
+
+
+ + diff --git a/doc/errinfo_at_line.html b/doc/errinfo_at_line.html new file mode 100644 index 0000000..351c8a3 --- /dev/null +++ b/doc/errinfo_at_line.html @@ -0,0 +1,101 @@ + + + + + errinfo_at_line + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

errinfo_at_line

+
+

#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.

+

Example:

+
#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;
+    }
+
+ + + + +
+
+
+ + diff --git a/doc/errinfo_errno.html b/doc/errinfo_errno.html new file mode 100644 index 0000000..7d85257 --- /dev/null +++ b/doc/errinfo_errno.html @@ -0,0 +1,103 @@ + + + + + errinfo_errno + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

errinfo_errno

+
+

#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.

+

Example:

+
#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;
+    }
+
+ + + + +
+
+
+ + diff --git a/doc/errinfo_file_handle.html b/doc/errinfo_file_handle.html new file mode 100644 index 0000000..6635c9d --- /dev/null +++ b/doc/errinfo_file_handle.html @@ -0,0 +1,102 @@ + + + + + errinfo_file_handle + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

errinfo_file_handle

+
+

#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.

+

Example:

+
#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;
+    }
+
+ + + + +
+
+
+ + diff --git a/doc/errinfo_file_name.html b/doc/errinfo_file_name.html new file mode 100644 index 0000000..6abfc32 --- /dev/null +++ b/doc/errinfo_file_name.html @@ -0,0 +1,103 @@ + + + + + errinfo_file_name + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

errinfo_file_name

+
+

#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.

+

Example:

+
#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;
+    }
+
+ + + + +
+
+
+ + diff --git a/doc/errinfo_file_open_mode.html b/doc/errinfo_file_open_mode.html new file mode 100644 index 0000000..74b0d79 --- /dev/null +++ b/doc/errinfo_file_open_mode.html @@ -0,0 +1,103 @@ + + + + + errinfo_file_open_mode + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

errinfo_file_open_mode

+
+

#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.

+

Example:

+
#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;
+    }
+
+ + + + +
+
+
+ + diff --git a/doc/errinfo_type_info_name.html b/doc/errinfo_type_info_name.html new file mode 100644 index 0000000..239b43c --- /dev/null +++ b/doc/errinfo_type_info_name.html @@ -0,0 +1,56 @@ + + + + + errinfo_type_info_name + + + +
+
+
+
+ +

Boost Exception

+
+ + + +

errinfo_type_info_name

+
+

#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.

+
+ + + + +
+
+
+ + diff --git a/doc/error_info.html b/doc/error_info.html index 366ce7b..15a36ee 100644 --- a/doc/error_info.html +++ b/doc/error_info.html @@ -59,6 +59,15 @@ typedef boost::error_info<struct tag_errno,int& 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<<:

+

See Also:

Boost Exception
diff --git a/doc/exception.html b/doc/exception.html index 5482617..76f6ea8 100644 --- a/doc/exception.html +++ b/doc/exception.html @@ -51,6 +51,13 @@ boost
Exception Types as Simple Semantic Tags
enable_current_exception
enable_error_info
+
errinfo_api_function
+
errinfo_at_line
+
errinfo_errno
+
errinfo_file_handle
+
errinfo_file_name
+
errinfo_file_open_mode
+
errinfo_type_info_name
error_info
exception/operator<<
exception::exception
diff --git a/doc/frequently_asked_questions.html b/doc/frequently_asked_questions.html index 3f3c988..f56254f 100644 --- a/doc/frequently_asked_questions.html +++ b/doc/frequently_asked_questions.html @@ -53,13 +53,13 @@ catch( ... ) std::cerr << "OMG!!!"; }

This is a possible message it may display, the first line is only possible if BOOST_THROW_EXCEPTION is used:

-
example_io.cpp(83): Throw in function void parse_file(const char *)
-Dynamic exception type: class file_open_error
+
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<class fopen_error>
 std::exception::what: example_io error
-[struct tag_errno_code *] = 2, OS says "No such file or directory"
-[struct tag_file_name *] = tmp1.xml
-[struct tag_function *] = fopen
-[struct tag_open_mode *] = rb
+[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

Why is boost::exception integrated in boost::throw_exception?

The boost::throw_exception function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::exception as a base of any exception passed to boost::throw_exception. Such concerns are dictated by the typical strict interpretation of a common principle in C and C++, that users only pay for features they actually use.

The problem is that users of Boost Exception can't by themselves cause a library to throw types that derive from boost::exception, and without this they can't use any of the Boost Exception facilities.

diff --git a/doc/headers.html b/doc/headers.html index 99f97f1..2011fcf 100644 --- a/doc/headers.html +++ b/doc/headers.html @@ -21,11 +21,18 @@

Headers

-
boost/exception.hpp
+
boost/exception/all.hpp
boost/exception/current_exception_cast.hpp
boost/exception/diagnostic_information.hpp
boost/exception/enable_current_exception.hpp
boost/exception/enable_error_info.hpp
+
boost/exception/errinfo_api_function.hpp
+
boost/exception/errinfo_at_line.hpp
+
boost/exception/errinfo_errno.hpp
+
boost/exception/errinfo_file_handle.hpp
+
boost/exception/errinfo_file_name.hpp
+
boost/exception/errinfo_file_open_mode.hpp
+
boost/exception/errinfo_type_info_name.hpp
boost/exception/error_info.hpp
boost/exception/exception.hpp
boost/exception/get_error_info.hpp
diff --git a/doc/page_idx.html b/doc/page_idx.html index 726a070..aba1239 100644 --- a/doc/page_idx.html +++ b/doc/page_idx.html @@ -25,11 +25,18 @@

B

BOOST_THROW_EXCEPTION

b

-

boost/exception.hpp

+

boost/exception/all.hpp

boost/exception/current_exception_cast.hpp

boost/exception/diagnostic_information.hpp

boost/exception/enable_current_exception.hpp

boost/exception/enable_error_info.hpp

+

boost/exception/errinfo_api_function.hpp

+

boost/exception/errinfo_at_line.hpp

+

boost/exception/errinfo_errno.hpp

+

boost/exception/errinfo_file_handle.hpp

+

boost/exception/errinfo_file_name.hpp

+

boost/exception/errinfo_file_open_mode.hpp

+

boost/exception/errinfo_type_info_name.hpp

boost/exception/error_info.hpp

boost/exception/exception.hpp

boost/exception/get_error_info.hpp

@@ -53,6 +60,13 @@

e

enable_current_exception

enable_error_info

+

errinfo_api_function

+

errinfo_at_line

+

errinfo_errno

+

errinfo_file_handle

+

errinfo_file_name

+

errinfo_file_open_mode

+

errinfo_type_info_name

error_info

error_info::error_info

error_info::value

diff --git a/doc/source/boost-exception.reno b/doc/source/boost-exception.reno index 62f89bf..b2d4bf9 100644 --- a/doc/source/boost-exception.reno +++ b/doc/source/boost-exception.reno @@ -39,7 +39,7 @@ - 57 + 73 0 @@ -53,28 +53,21 @@ - 1 - D9B8E6AA12A4F33953B1A961FA590C5A3840234B6531CA8C04AC985AD5800835 - 2432554768 - 702 - 408 + 0 - 0 - ../../example/enable_error_info.cpp - 0 - 0 + 1 - <string>integrating boost exception in existing exception class hierarchies</string> + <string>using virtual inheritance in exception types</string> - tutorial_enable_error_info + @@ -99,1177 +92,14 @@ 2 - F7633FDCF6615C0199645701EE6E7ACE5CBCD7A7CF6838573791E91ABB3C09F2 - 1668435395 - 1332 - 396 - A1F443AF571973A12005D2F7D4AE09A32AAF686FEEAE272EC21512A65EB943E8 - 3879093659 - 1300 - 26 - - - - - - 0 - ../../../../boost/exception/info_tuple.hpp - 0 - 0 - - - - - <string>tuple/operator<<</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 7 - - reno_context - - - - - - - 1 - F4C951B28F7DE500973AA3DFAA99F2BADA6EDAFA2B406C30BEF3B7FBE6FD57D7 - 2263754923 - 982 - 306 - - - - - - 0 - ../../example/error_info_2.cpp - 0 - 0 - - - - - <string>adding of arbitrary data to active exception objects</string> - - - adding_data_later - - - - - - 0 - - - - - 0 - - 8 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>page index</string> - - - page_idx - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 9 - - reno_context - - - - - - - 1 - A14B5595A6DD87562792D402B48500AAD71FA1ABD75C14EDF089FCC7318CBB9B - 3469762901 - 468 - 227 - - - - - - 0 - ../../../../boost/exception/current_exception_cast.hpp - 0 - 0 - - - - - <string>boost/exception/current_exception_cast.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 10 - - reno_context - - - - - - - 1 - 21E8093D2AF6946EAE135823066EF38B9DC8870432B44C81E585FF63A72F9903 - 3352783584 - 12170 - 323 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>boost/exception_ptr.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 11 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>boost/exception/enable_current_exception.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 12 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>boost exception</string> - - - boost-exception - - - - - - 1 - 2 - (:include include:) - - - - - 0 - - 13 - - reno_context - - - - - - - 2 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 - 1693870740 - 2195 - 3720 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>exception</string> - - - - - - - - - 1 - 2 - (:include include:) ---- !!!See Also: (:pagelist link="backlink" except_tags="exception,member" mod="w":) - - - - - 0 - - 14 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>transporting of arbitrary data to the catch site</string> - - - tutorial_transporting_data - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 15 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Motivation</string> - - - motivation - - - - - - 7 - 2 - (:include include:) (:auto also explicit=" - 1 - - 0 - - 16 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>exception types as simple semantic tags</string> - - - - - - - - 2 - - 1 - - 0 - - -5 - - - 2 - - 1 - - 0 - - 17 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>frequently asked questions</string> - - - - - - - - 2 - ":) - - - - - 0 - - 18 - - reno_context - - - - - - - 2 - D57BF77EE44CD2755E24A56DDC3E159716D04A7ABE009AE977D4926EFEC00F73 - 2498368808 - 973 - 3941 - 9432C669E21C649A86AC6DC5A34275B483A7D2D38118A462DF1C1CD7BBE5ED51 - 2535426829 - 441 - 110 - - - - - - 0 - ../../../../boost/exception/diagnostic_information.hpp - 0 - 0 - - - - - <string>current_exception_diagnostic_information</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 19 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Types</string> - - - types - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 20 - - reno_context - - - - - - - 2 - AED5E79246B32BDF0E5C6CD8BDDC3370FD0BA1EFE3D4CE76C4A6D36A123F2E20 - 228982966 - 3918 - 518 - D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 - 4055211476 - 525 - 3387 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>exception/operator<<</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 21 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>transporting of exceptions between threads</string> - - - tutorial_exception_ptr - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 22 - - reno_context - - - - - - - 1 - 4ED9709788BBAB4DE7CF336561606B8C0B41F70877A3395F4EE026F4AEB66CC6 - 743998427 - 409 - 307 - - - - - - 0 - ../../example/cloning_1.cpp - 0 - 0 - - - - - <string>using enable_current_exception at the time of the throw</string> - - - using_enable_cloning - - - - - - 0 - - - - - 0 - - 23 - - reno_context - - - - - - - 1 - F647827E95C64B626A8E3751AD4E4D21237DD17482EEA6DB93A16A2C6AC79E87 - 527078204 - 446 - 227 - - - - - - 0 - ../../../../boost/exception.hpp - 0 - 0 - - - - - <string>boost/exception.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 24 - - reno_context - - - - - - - 1 - 9E8DCE3BCF462A3A332DA70F61E46FA5C2AB791B95E33D3F2AF1307F53C84B1C - 1960675522 - 6483 - 591 - - - - - - 0 - ../../example/example_io.cpp - 0 - 0 - - - - - <string>diagnostic_information example</string> - - - - - - - - - 0 - - - - - 0 - - 25 - - reno_context - - - - - - - 2 - CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 - 1114955626 - 11770 - 723 - B20A3D4631F3B2415EED1888B65FA33D7AED20F86BE196159D9297AAED115787 - 3293519666 - 117 - 11169 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>rethrow_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 26 - - reno_context - - - - - - - 1 - D10E536B909EFFF78FB09E6242AEC7C74ACDD75AE7DF32B45870422B752E5D8E - 1903336130 - 557 - 382 - - - - - - 0 - ../../example/error_info_1.cpp - 0 - 0 - - - - - <string>adding of arbitrary data at the point of the throw</string> - - - adding_data_at_throw - - - - - - 0 - - - - - 0 - - 27 - - reno_context - - - - - - - 1 - 641BB230CEBF638811480BE0E3A96ABCB7CC9CC7E1C1A9C51FBAB296FFB6B7B1 - 4248389286 - 4113 - 323 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>boost/exception/info.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 28 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>boost/exception/enable_error_info.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 29 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Functions</string> - - - functions - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 30 - - reno_context - - - - - - - 3 - 126BB1D8971585CBE7D78EF3C12259D72FD5E973A84626AA9FC3234220A11CAB - 3471702891 - 969 - 344 - A7FD310E1340E103081DA2A7899DA0E213C696C84D52C17ADA09F6942EE97D47 - 2978648279 - 530 - 433 - 02372FA6B987EAC15E78C5A12036F203A92B3D4C857C02985B1BF0A24008D976 - 2987989218 - 109 - 259 - - - - - - 0 - ../../../../boost/exception/detail/error_info_impl.hpp - 0 - 0 - - - - - <string>error_info::value</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 31 - - reno_context - - - - - - - 2 - FEABD2D011FBCE667D26BAD68A1C65D81E98DD40081CC70F2738AC3151A8FC4A - 4260129224 - 2393 - 504 - C708EDCAC3964E2F3C3A081700112C5F15C7BF7A61FDF2EF39D112FC9B987CE3 - 1739153824 - 2361 - 26 - - - - - - 0 - ../../../../boost/exception/get_error_info.hpp - 0 - 0 - - - - - <string>get_error_info</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 32 - - reno_context - - - - - - - 1 - 04DDC793002AFCF4F4166D250C67D09B6FE8B86224318ED7847AD6EC423B70CA - 922651615 - 433 - 1032 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - - <string>BOOST_THROW_EXCEPTION</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 33 - - reno_context - - - - - - - 2 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 + 625285100233119FB4542EB54530FC7CB802D9A50B06D6CFB397730CDB1ED7D8 + 4080542391 + 9174 323 F3FB15CD82336271C6E875BC620385322777D16F0B7C233300783CE35710CCBF 3292878997 282 - 7305 + 7287 @@ -1301,7 +131,7 @@ 0 - 34 + 7 reno_context @@ -1311,24 +141,24 @@ 1 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 + 80C86365052AA49654F75CAA87BF9B29C6373A01F8EE4D5E79F317CD76FC0718 + 622934727 + 6161 + 412 0 - ../../../../boost/exception/exception.hpp + ../../example/example_io.cpp 0 0 - <string>boost/exception/exception.hpp</string> + <string>diagnostic_information example</string> @@ -1337,69 +167,14 @@ - 1 - 2 - (:include include:) (:auto also:) + 0 0 - 35 - - reno_context - - - - - - - 3 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 - 1693870740 - 2195 - 3720 - DA154372D8C23BD9EDC30005CA7959CE686D198891097A837D006B5222F04DE9 - 2768248809 - 143 - 60 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>exception::exception</string> - - - exception_constructors - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 36 + 8 reno_context @@ -1448,7 +223,7 @@ 0 - 37 + 9 reno_context @@ -1458,9 +233,9 @@ 1 - 2F432507CFD796BE673F33D9AC68C535F1ED1F4FCD3A8E3AEEC320D9795FB4AE - 2319362875 - 2574 + 21E8093D2AF6946EAE135823066EF38B9DC8870432B44C81E585FF63A72F9903 + 3352783584 + 12170 323 @@ -1468,14 +243,14 @@ 0 - ../../../../boost/exception/get_error_info.hpp + ../../../../boost/exception_ptr.hpp 0 0 - <string>boost/exception/get_error_info.hpp</string> + <string>boost/exception_ptr.hpp</string> @@ -1493,7 +268,50 @@ 0 - 38 + 10 + + reno_context + + + + + + + 1 + 28E8289766B2CDAEF0A407A6389CB9F7FD3B0F4B49B15CB73AF210A1CEB60C58 + 4196332848 + 735 + 363 + + + + + + 0 + ../../example/info_tuple.cpp + 0 + 0 + + + + + <string>adding grouped data to exceptions</string> + + + grouping_data + + + + + + 0 + + + + + 0 + + 11 reno_context @@ -1503,31 +321,31 @@ 2 - 9A4ECF9A49A73AED83C1565CB8C67AE1519E8AFE6818F968B4C4733CB9E86CEF - 1615599655 - 68 - 227 - 34F0583BC8DE767CE2D79721E1F956895E43E5397473B1050F59BE7E26C773DB - 805836816 - 66 - 1 + 625285100233119FB4542EB54530FC7CB802D9A50B06D6CFB397730CDB1ED7D8 + 4080542391 + 9174 + 323 + 17E691632123EB67BA67D590B49EB8094F462F5A10A66A1C5438E1867EF1478E + 765399792 + 77 + 5899 0 - ../../../../boost/exception/error_info.hpp + ../../../../boost/exception/exception.hpp 0 0 - <string>boost/exception/error_info.hpp</string> + <string>exception::~exception</string> - + exception_destructor @@ -1542,71 +360,7 @@ 0 - -17 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - -16 - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 39 - - reno_context - - - - - - - 0 - - - - - - 1 - - - - - <string>Headers</string> - - - headers - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 40 + 12 reno_context @@ -1616,24 +370,24 @@ 1 - CAD6C404CB725D336A44920D2341ECA131149AB02C368B59028F8147F16737BF - 2258638601 - 94 - 227 + E0BE7EFCD5550582AB95C9EEDA6E68CA0F89B19838DA61876D42161E1EA4AE71 + 2587249979 + 233 + 323 0 - ../../../../boost/exception/info_tuple.hpp + ../../../../boost/exception/errinfo_at_line.hpp 0 0 - <string>boost/exception/info_tuple.hpp</string> + <string>boost/exception/errinfo_at_line.hpp</string> @@ -1651,52 +405,7 @@ 0 - 41 - - reno_context - - - - - - - 1 - BEFF039468E0E9A3719E5CB51DA9710812D146B587BAF573D1670908BB97C0CA - 35548578 - 1983 - 91 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - - <string>boost/throw_exception.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 42 + 13 reno_context @@ -1745,7 +454,719 @@ 0 - 43 + 14 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>page index</string> + + + page_idx + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 15 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>frequently asked questions</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 16 + + reno_context + + + + + + + 2 + 625285100233119FB4542EB54530FC7CB802D9A50B06D6CFB397730CDB1ED7D8 + 4080542391 + 9174 + 323 + 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 + 1693870740 + 2195 + 3702 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>exception</string> + + + + + + + + + 1 + 2 + (:include include:) ---- !!!See Also: (:pagelist link="backlink" except_tags="exception,member" mod="w":) + + + + + 0 + + 17 + + reno_context + + + + + + + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + E23085202D084CBB50F289988A6A592F06D923B77D0AB25D7A98A7188DF5BE3B + 1414247481 + 766 + 10094 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>current_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 18 + + reno_context + + + + + + + 2 + AED5E79246B32BDF0E5C6CD8BDDC3370FD0BA1EFE3D4CE76C4A6D36A123F2E20 + 228982966 + 3918 + 518 + 6E325144EF4F41FA3A225EB30729101382C4E99B3D6160E307311E4B4E641010 + 1097215175 + 161 + 240 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>error_info::error_info</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 19 + + reno_context + + + + + + + 1 + 95AD55ACCB1C17C1DBA4C309BDFCBD4B66E52CD9A2F54FDAD2D642A00342D001 + 3194412598 + 4599 + 323 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + + <string>boost/exception/diagnostic_information.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 20 + + reno_context + + + + + + + 1 + F39D869016327CDFEA720920B2743F47989202BF5814B6556EC54A1B0FE562F8 + 3703518029 + 147 + 323 + + + + + + 0 + ../../../../boost/exception.hpp + 0 + 0 + + + + + <string>boost/exception.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 21 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Functions</string> + + + functions + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 22 + + reno_context + + + + + + + 2 + 6FB85B536F965F137409D5B5D34786DCBF0B9957A7C251D271B717A1156B823D + 1090406464 + 362 + 323 + D16DAEA8B1792A019AF7FCA362FDC6EFD381AF4C43C076A01C029ECE51F994A6 + 3172941848 + 330 + 26 + + + + + + 0 + ../../../../boost/exception/current_exception_cast.hpp + 0 + 0 + + + + + <string>current_exception_cast</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 23 + + reno_context + + + + + + + 1 + FFF4359EFC66EE6AA729B641F38B4020A55E83A1C099BCA59B1CA9A9875E7F79 + 366628170 + 236 + 323 + + + + + + 0 + ../../../../boost/exception/errinfo_file_handle.hpp + 0 + 0 + + + + + <string>boost/exception/errinfo_file_handle.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 24 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>transporting of exceptions between threads</string> + + + tutorial_exception_ptr + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 25 + + reno_context + + + + + + + 1 + D194983FA4C182AB869F1AB542797B3EDCCBAEB0A6E67B2DCEE5EA2C7F58853C + 1308852571 + 395 + 307 + + + + + + 0 + ../../example/cloning_1.cpp + 0 + 0 + + + + + <string>using enable_current_exception at the time of the throw</string> + + + using_enable_cloning + + + + + + 0 + + + + + 0 + + 26 + + reno_context + + + + + + + 2 + AEDDD2FA4F47CEBD99444F1054D85AB8132748CF38D6634503D62E9C8AD5FE68 + 1378637100 + 292 + 368 + 892C0239798B84BA2E80DAA70BBEB7BE0B6086A1D0829D0E1937EC1D19E3FF20 + 3349881047 + 89 + 197 + + + + + + 0 + ../../../../boost/exception/errinfo_api_function.hpp + 0 + 0 + + + + + <string>errinfo_api_function</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 27 + + reno_context + + + + + + + 1 + 2F432507CFD796BE673F33D9AC68C535F1ED1F4FCD3A8E3AEEC320D9795FB4AE + 2319362875 + 2574 + 323 + + + + + + 0 + ../../../../boost/exception/get_error_info.hpp + 0 + 0 + + + + + <string>boost/exception/get_error_info.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 28 + + reno_context + + + + + + + 2 + 625285100233119FB4542EB54530FC7CB802D9A50B06D6CFB397730CDB1ED7D8 + 4080542391 + 9174 + 323 + DF9EA87B0140AACF4422F1B76F6A6A409C15F32858BBBA85A35981A824C56BA9 + 1137981799 + 192 + 8976 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>enable_current_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 29 + + reno_context + + + + + + + 1 + 0F429704770B5772E81B2BC74E962B62F83826D6C885B7C6E7186D127D31B291 + 1345125619 + 854 + 306 + + + + + + 0 + ../../example/error_info_2.cpp + 0 + 0 + + + + + <string>adding of arbitrary data to active exception objects</string> + + + adding_data_later + + + + + + 0 + + + + + 0 + + 30 reno_context @@ -1798,101 +1219,7 @@ 0 - 44 - - reno_context - - - - - - - 2 - 126BB1D8971585CBE7D78EF3C12259D72FD5E973A84626AA9FC3234220A11CAB - 3471702891 - 969 - 344 - A7FD310E1340E103081DA2A7899DA0E213C696C84D52C17ADA09F6942EE97D47 - 2978648279 - 530 - 433 - - - - - - 0 - ../../../../boost/exception/detail/error_info_impl.hpp - 0 - 0 - - - - - <string>error_info</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 45 - - reno_context - - - - - - - 1 - 95AD55ACCB1C17C1DBA4C309BDFCBD4B66E52CD9A2F54FDAD2D642A00342D001 - 3194412598 - 4599 - 323 - - - - - - 0 - ../../../../boost/exception/diagnostic_information.hpp - 0 - 0 - - - - - <string>boost/exception/diagnostic_information.hpp</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 46 + 31 reno_context @@ -1941,7 +1268,966 @@ 0 - 47 + 32 + + reno_context + + + + + + + 2 + 21027A2B73C9AA6FF083752A952D63BBA9B5FD68A3C8915965A7184EA62A5D61 + 1523356166 + 537 + 403 + 24256E1CE56594FB38D0630858B8947191827CFC57771E8727A6A56F76207454 + 665917505 + 66 + 26 + + + + + + 0 + ../../../../boost/exception/errinfo_errno.hpp + 0 + 0 + + + + + <string>errinfo_errno</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 33 + + reno_context + + + + + + + 2 + CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 + 1114955626 + 11770 + 723 + B20A3D4631F3B2415EED1888B65FA33D7AED20F86BE196159D9297AAED115787 + 3293519666 + 117 + 11169 + + + + + + 0 + ../../../../boost/exception_ptr.hpp + 0 + 0 + + + + + <string>rethrow_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 34 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Types</string> + + + types + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 35 + + reno_context + + + + + + + 1 + A14B5595A6DD87562792D402B48500AAD71FA1ABD75C14EDF089FCC7318CBB9B + 3469762901 + 468 + 227 + + + + + + 0 + ../../../../boost/exception/current_exception_cast.hpp + 0 + 0 + + + + + <string>boost/exception/current_exception_cast.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 36 + + reno_context + + + + + + + 2 + 15CF5BD93D20D62D659C11A69330B06E408398EA488BEF1FD45437AADCDB424E + 1232553666 + 214 + 345 + 6262783847165581298EC9500031E6B7A97B2751A9CEF67C4794121A78142C58 + 3676119191 + 90 + 118 + + + + + + 0 + ../../../../boost/exception/errinfo_file_handle.hpp + 0 + 0 + + + + + <string>errinfo_file_handle</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 37 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>boost/exception/enable_current_exception.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 38 + + reno_context + + + + + + + 1 + FC684D0DD5A9732B4130F2AB3DB6E0491D0F523E14B7FB738B2019EA2C7F8717 + 2229778754 + 631 + 319 + + + + + + 0 + ../../example/cloning_2.cpp + 0 + 0 + + + + + <string>cloning and re-throwing an exception</string> + + + cloning_and_rethrowing + + + + + + 0 + + + + + 0 + + 39 + + reno_context + + + + + + + 1 + 21A43755562CB78B3FFCC49F66B457C1FCD659EE98F25BBFA8DDE453EB89DF0E + 2576704708 + 337 + 323 + + + + + + 0 + ../../../../boost/exception/errinfo_api_function.hpp + 0 + 0 + + + + + <string>boost/exception/errinfo_api_function.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 40 + + reno_context + + + + + + + 3 + 126BB1D8971585CBE7D78EF3C12259D72FD5E973A84626AA9FC3234220A11CAB + 3471702891 + 969 + 344 + A7FD310E1340E103081DA2A7899DA0E213C696C84D52C17ADA09F6942EE97D47 + 2978648279 + 530 + 433 + 02372FA6B987EAC15E78C5A12036F203A92B3D4C857C02985B1BF0A24008D976 + 2987989218 + 109 + 259 + + + + + + 0 + ../../../../boost/exception/detail/error_info_impl.hpp + 0 + 0 + + + + + <string>error_info::value</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 41 + + reno_context + + + + + + + 2 + F7633FDCF6615C0199645701EE6E7ACE5CBCD7A7CF6838573791E91ABB3C09F2 + 1668435395 + 1332 + 396 + A1F443AF571973A12005D2F7D4AE09A32AAF686FEEAE272EC21512A65EB943E8 + 3879093659 + 1300 + 26 + + + + + + 0 + ../../../../boost/exception/info_tuple.hpp + 0 + 0 + + + + + <string>tuple/operator<<</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 42 + + reno_context + + + + + + + 3 + 625285100233119FB4542EB54530FC7CB802D9A50B06D6CFB397730CDB1ED7D8 + 4080542391 + 9174 + 323 + 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 + 1693870740 + 2195 + 3702 + DA154372D8C23BD9EDC30005CA7959CE686D198891097A837D006B5222F04DE9 + 2768248809 + 143 + 60 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>exception::exception</string> + + + exception_constructors + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 43 + + reno_context + + + + + + + 2 + AED5E79246B32BDF0E5C6CD8BDDC3370FD0BA1EFE3D4CE76C4A6D36A123F2E20 + 228982966 + 3918 + 518 + D31BCE814DF5B8B718E7EB67A194AD08EF716A26D422E436596ABA1F145007D8 + 4055211476 + 525 + 3387 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>exception/operator<<</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 44 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>boost exception</string> + + + boost-exception + + + + + + 1 + 2 + (:include include:) + + + + + 0 + + 45 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>Motivation</string> + + + motivation + + + + + + 7 + 2 + (:include include:) (:auto also explicit=" + 1 + + 0 + + 46 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>exception types as simple semantic tags</string> + + + + + + + + 2 + + 1 + + 0 + + 47 + + reno_context + + + + + + + 1 + C95CEF2E9D0BAA1E950509471062916DB849A46A19F7692BA478030E79B338EB + 1917376632 + 706 + 408 + + + + + + 0 + ../../example/enable_error_info.cpp + 0 + 0 + + + + + <string>integrating boost exception in existing exception class hierarchies</string> + + + tutorial_enable_error_info + + + + + 2 + + 1 + + 0 + + -15 + + + 2 + ":) + + + + + 0 + + 48 + + reno_context + + + + + + + 2 + 126A895281064E2195458B8A47CD73DB7E3BE3608F250925E07AF4230CBDDE1D + 4231421785 + 307 + 344 + 16179B125E2BC6D993FBE4BA5E9A96DBAE43CA1443C7D281B659D020B6725983 + 1126376090 + 92 + 209 + + + + + + 0 + ../../../../boost/exception/errinfo_type_info_name.hpp + 0 + 0 + + + + + <string>errinfo_type_info_name</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 49 + + reno_context + + + + + + + 1 + 04DDC793002AFCF4F4166D250C67D09B6FE8B86224318ED7847AD6EC423B70CA + 922651615 + 433 + 1061 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>BOOST_THROW_EXCEPTION</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 50 + + reno_context + + + + + + + 2 + D57BF77EE44CD2755E24A56DDC3E159716D04A7ABE009AE977D4926EFEC00F73 + 2498368808 + 973 + 3941 + 9432C669E21C649A86AC6DC5A34275B483A7D2D38118A462DF1C1CD7BBE5ED51 + 2535426829 + 441 + 110 + + + + + + 0 + ../../../../boost/exception/diagnostic_information.hpp + 0 + 0 + + + + + <string>current_exception_diagnostic_information</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + -46 + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 51 + + reno_context + + + + + + + 1 + 2CCD2A79129C832AB12435E43BB35DE67318A8940A36530EF83C5E617987D661 + 2091122505 + 699 + 323 + + + + + + 0 + ../../../../boost/exception/all.hpp + 0 + 0 + + + + + <string>boost/exception/all.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 52 + + reno_context + + + + + + + 0 + + + + + + 1 + + + + + <string>boost/exception/enable_error_info.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 53 reno_context @@ -1990,7 +2276,257 @@ 0 - 48 + -47 + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 54 + + reno_context + + + + + + + 1 + A95165313334B684C85659D05D3D8EB17F4AF552EDCB3C180AC1F85D18C99CBF + 115507474 + 2037 + 91 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>boost/throw_exception.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 55 + + reno_context + + + + + + + 2 + 307034E20863A00923777A60D9495B4076B7F917D5B97203025299060F0833E0 + 3948311309 + 396 + 344 + F8ED2052577830AC0C515EC5932BB14445DD5DA714782281FCDB1776961FECB1 + 3880328768 + 82 + 308 + + + + + + 0 + ../../../../boost/exception/errinfo_file_name.hpp + 0 + 0 + + + + + <string>errinfo_file_name</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 56 + + reno_context + + + + + + + 2 + FEABD2D011FBCE667D26BAD68A1C65D81E98DD40081CC70F2738AC3151A8FC4A + 4260129224 + 2393 + 504 + C708EDCAC3964E2F3C3A081700112C5F15C7BF7A61FDF2EF39D112FC9B987CE3 + 1739153824 + 2361 + 26 + + + + + + 0 + ../../../../boost/exception/get_error_info.hpp + 0 + 0 + + + + + <string>get_error_info</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 57 + + reno_context + + + + + + + 2 + DA1CAA5F6BAB712AD89E8A0B7D83961FCE4AF9FD198791C9F6EA299800A64FAC + 3553871704 + 612 + 1496 + 154AC930BD1FDCADE24CDB07DBD3163CA26378AF4F1D428C34B67D1F68A60891 + 50905072 + 586 + 23 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + + <string>throw_exception</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 58 + + reno_context + + + + + + + 1 + DE766B811244919E8E1EA54FC747A8487BCE57F1AB592932640FC90428B617A5 + 414875037 + 427 + 323 + + + + + + 0 + ../../../../boost/exception/errinfo_file_open_mode.hpp + 0 + 0 + + + + + <string>boost/exception/errinfo_file_open_mode.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 59 reno_context @@ -2028,7 +2564,7 @@ 0 - 49 + 60 reno_context @@ -2037,28 +2573,32 @@ - 1 - 7116AEECEA666794E31DC99390ADEC1BA6AF74B2398067A0739767B4B76FA97A - 4128134227 - 307 - 302 + 2 + 9A4ECF9A49A73AED83C1565CB8C67AE1519E8AFE6818F968B4C4733CB9E86CEF + 1615599655 + 68 + 227 + 34F0583BC8DE767CE2D79721E1F956895E43E5397473B1050F59BE7E26C773DB + 805836816 + 66 + 1 0 - ../../example/logging.cpp + ../../../../boost/exception/error_info.hpp 0 0 - <string>diagnostic information</string> + <string>boost/exception/error_info.hpp</string> - tutorial_diagnostic_information + @@ -2073,7 +2613,7 @@ 0 - 50 + 61 reno_context @@ -2122,7 +2662,287 @@ 0 - 51 + 62 + + reno_context + + + + + + + 1 + 977045132A532A0071B0B53F737D85367CE9A331402F96790E45B3B6F2FC88A6 + 1875939463 + 529 + 382 + + + + + + 0 + ../../example/error_info_1.cpp + 0 + 0 + + + + + <string>adding of arbitrary data at the point of the throw</string> + + + adding_data_at_throw + + + + + + 0 + + + + + 0 + + 63 + + reno_context + + + + + + + 1 + 283AE6BE0920B1882100C426958FDF998DEE10226546B300B45C1A26B242FC25 + 722381934 + 617 + 323 + + + + + + 0 + ../../../../boost/exception/errinfo_errno.hpp + 0 + 0 + + + + + <string>boost/exception/errinfo_errno.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 64 + + reno_context + + + + + + + 1 + 625285100233119FB4542EB54530FC7CB802D9A50B06D6CFB397730CDB1ED7D8 + 4080542391 + 9174 + 323 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + + <string>boost/exception/exception.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 65 + + reno_context + + + + + + + 2 + E0BE7EFCD5550582AB95C9EEDA6E68CA0F89B19838DA61876D42161E1EA4AE71 + 2587249979 + 233 + 323 + 92AB508A6B1C2A62CB2ACED423BD04BB5A471674B5A51BFC1E6FB1F5C92AF9AA + 2372475309 + 70 + 157 + + + + + + 0 + ../../../../boost/exception/errinfo_at_line.hpp + 0 + 0 + + + + + <string>errinfo_at_line</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 66 + + reno_context + + + + + + + 2 + EEA69AA1E84CB2B7C903A3F4C236D0A233D03DBA4BA1D3B97D959918F3B30E09 + 2728032055 + 406 + 344 + EE695B95A2499B66980754857E184776F1DE7224372A5F5153B6DF94E621A89B + 1009590890 + 92 + 308 + + + + + + 0 + ../../../../boost/exception/errinfo_file_open_mode.hpp + 0 + 0 + + + + + <string>errinfo_file_open_mode</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 67 + + reno_context + + + + + + + 2 + 126BB1D8971585CBE7D78EF3C12259D72FD5E973A84626AA9FC3234220A11CAB + 3471702891 + 969 + 344 + A7FD310E1340E103081DA2A7899DA0E213C696C84D52C17ADA09F6942EE97D47 + 2978648279 + 530 + 433 + + + + + + 0 + ../../../../boost/exception/detail/error_info_impl.hpp + 0 + 0 + + + + + <string>error_info</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 68 reno_context @@ -2132,18 +2952,18 @@ 3 - 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A - 1770110914 - 587 - 1467 - 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D - 3929437933 - 361 - 213 + DA1CAA5F6BAB712AD89E8A0B7D83961FCE4AF9FD198791C9F6EA299800A64FAC + 3553871704 + 612 + 1496 + 154AC930BD1FDCADE24CDB07DBD3163CA26378AF4F1D428C34B67D1F68A60891 + 50905072 + 586 + 23 CD1241D84950468704F3C3F04116B8DA5162A8BEA4364F10951232F49113C5DE 1658463867 121 - 238 + 453 @@ -2175,338 +2995,7 @@ 0 - 52 - - reno_context - - - - - - - 2 - CEB9022E39DA32E612158FF553D383E13D300D1202CEB754E28B716040EFC414 - 1114955626 - 11770 - 723 - E23085202D084CBB50F289988A6A592F06D923B77D0AB25D7A98A7188DF5BE3B - 1414247481 - 766 - 10094 - - - - - - 0 - ../../../../boost/exception_ptr.hpp - 0 - 0 - - - - - <string>current_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 53 - - reno_context - - - - - - - 2 - 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A - 1770110914 - 587 - 1467 - 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D - 3929437933 - 361 - 213 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - - <string>throw_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 54 - - reno_context - - - - - - - 2 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - 17E691632123EB67BA67D590B49EB8094F462F5A10A66A1C5438E1867EF1478E - 765399792 - 77 - 5917 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>exception::~exception</string> - - - exception_destructor - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 55 - - reno_context - - - - - - - 2 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - DF9EA87B0140AACF4422F1B76F6A6A409C15F32858BBBA85A35981A824C56BA9 - 1137981799 - 192 - 8994 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - - <string>enable_current_exception</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 56 - - reno_context - - - - - - - 1 - E444EE9697EEADFDE0767E1D0242FC0E70D98E61FB1F0FFA099648DE509B82F3 - 94503238 - 773 - 374 - - - - - - 0 - ../../example/info_tuple.cpp - 0 - 0 - - - - - <string>adding grouped data to exceptions</string> - - - grouping_data - - - - - - 0 - - - - - 0 - - 57 - - reno_context - - - - - - - 1 - FC684D0DD5A9732B4130F2AB3DB6E0491D0F523E14B7FB738B2019EA2C7F8717 - 2229778754 - 631 - 319 - - - - - - 0 - ../../example/cloning_2.cpp - 0 - 0 - - - - - <string>cloning and re-throwing an exception</string> - - - cloning_and_rethrowing - - - - - - 0 - - - - - 0 - - 58 - - reno_context - - - - - - - 2 - AED5E79246B32BDF0E5C6CD8BDDC3370FD0BA1EFE3D4CE76C4A6D36A123F2E20 - 228982966 - 3918 - 518 - 6E325144EF4F41FA3A225EB30729101382C4E99B3D6160E307311E4B4E641010 - 1097215175 - 161 - 240 - - - - - - 0 - ../../../../boost/exception/info.hpp - 0 - 0 - - - - - <string>error_info::error_info</string> - - - - - - - - - 1 - 2 - (:include include:) (:auto also:) - - - - - 0 - - 59 + 69 reno_context @@ -2526,7 +3015,52 @@ - <string>using virtual inheritance in exception types</string> + <string>transporting of arbitrary data to the catch site</string> + + + tutorial_transporting_data + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 70 + + reno_context + + + + + + + 1 + 66EFC83C830F0B00D0C9399B475099072E2674B3C694F9152645A33E3D7AC303 + 561674611 + 417 + 323 + + + + + + 0 + ../../../../boost/exception/errinfo_file_name.hpp + 0 + 0 + + + + + <string>boost/exception/errinfo_file_name.hpp</string> @@ -2544,7 +3078,187 @@ 0 - 60 + 71 + + reno_context + + + + + + + 1 + 641BB230CEBF638811480BE0E3A96ABCB7CC9CC7E1C1A9C51FBAB296FFB6B7B1 + 4248389286 + 4113 + 323 + + + + + + 0 + ../../../../boost/exception/info.hpp + 0 + 0 + + + + + <string>boost/exception/info.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 72 + + reno_context + + + + + + + 1 + 4EDD3DF2332B6D9D22AC9AD90B850ACC715A24DD466E675014CBED25C63C255F + 4175717823 + 328 + 323 + + + + + + 0 + ../../../../boost/exception/errinfo_type_info_name.hpp + 0 + 0 + + + + + <string>boost/exception/errinfo_type_info_name.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 73 + + reno_context + + + + + + + 1 + CAD6C404CB725D336A44920D2341ECA131149AB02C368B59028F8147F16737BF + 2258638601 + 94 + 227 + + + + + + 0 + ../../../../boost/exception/info_tuple.hpp + 0 + 0 + + + + + <string>boost/exception/info_tuple.hpp</string> + + + + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 74 + + reno_context + + + + + + + 1 + 66E0BD9724AB83012F5B35D887E3313960DC0E69B94E0C03CA1F3C85A0D84A5C + 2883671483 + 311 + 306 + + + + + + 0 + ../../example/logging.cpp + 0 + 0 + + + + + <string>diagnostic information</string> + + + tutorial_diagnostic_information + + + + + + 1 + 2 + (:include include:) (:auto also:) + + + + + 0 + + 75 reno_context @@ -2582,7 +3296,7 @@ 0 - 61 + 76 reno_context @@ -2591,32 +3305,21 @@ - 2 - 6FB85B536F965F137409D5B5D34786DCBF0B9957A7C251D271B717A1156B823D - 1090406464 - 362 - 323 - D16DAEA8B1792A019AF7FCA362FDC6EFD381AF4C43C076A01C029ECE51F994A6 - 3172941848 - 330 - 26 + 0 - 0 - ../../../../boost/exception/current_exception_cast.hpp - 0 - 0 + 1 - <string>current_exception_cast</string> + <string>Headers</string> - + headers @@ -2627,6 +3330,49 @@ (:include include:) (:auto also:) + + + 0 + + 77 + + reno_context + + + + + + + 1 + F812D8AE60189369CED7A3FD72733A65B57D56637E6721867F52A82EB319731A + 3974553696 + 1432 + 352 + + + + + + 0 + ../../example/errinfos.cpp + 0 + 0 + + + + + <string>errinfos example</string> + + + + + + + + + 0 + + @@ -2634,13 +3380,13 @@ def - 62 + 78 reno_layer - 57 + 73 0 @@ -2736,6 +3482,39 @@ -13 + + 0 + + + + + 0 + + -14 + + + + 0 + + + + + 0 + + -15 + + + + 0 + + + + + 0 + + -16 + + 7 2 @@ -2744,716 +3523,12 @@ 0 - -13 + -16 2 :) { protected: (:include 1 - - 0 - - -35 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -54 - - - 2 - decl pre_indent="4":) };@] - - - - - 0 - - -14 - - - - 0 - - - - - 0 - - -15 - - - - 0 - - - - - 0 - - -18 - - - - 0 - - - - - 0 - - -19 - - - - 0 - - - - - 0 - - -20 - - - - 0 - - - - - 0 - - -21 - - - - 0 - - - - - 0 - - -22 - - - - 0 - - - - - 0 - - -23 - - - - 0 - - - - - 0 - - -24 - - - - 0 - - - - - 0 - - -25 - - - - 0 - - - - - 0 - - -26 - - - - 0 - - - - - 0 - - -27 - - - - 0 - - - - - 0 - - -28 - - - - 0 - - - - - 0 - - -29 - - - - 0 - - - - - 0 - - -30 - - - - 0 - - - - - 0 - - -31 - - - - 0 - - - - - 0 - - -32 - - - - 0 - - - - - 0 - - -33 - - - - 0 - - - - - 0 - - -34 - - - - 0 - - - - - 0 - - -35 - - - - 0 - - - - - 0 - - -36 - - - - 0 - - - - - 0 - - -37 - - - - 0 - - - - - 0 - - -38 - - - - 0 - - - - - 0 - - -17 - - - - 0 - - - - - 0 - - -16 - - - - 0 - - - - - 0 - - -39 - - - - 0 - - - - - 0 - - -40 - - - - 0 - - - - - 0 - - -41 - - - - 0 - - - - - 0 - - -42 - - - - 0 - - - - - 0 - - -43 - - - - 0 - - - - - 0 - - -44 - - - - 9 - 2 - [@template <class Tag,class T> class (:link - 1 - - 0 - - -44 - - - 2 - :) { public: (:include - 1 - - 0 - - -43 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -58 - - - 2 - decl pre_indent="4":) (:include - 1 - - 0 - - -30 - - - 2 - decl pre_indent="4":) };@] - - - - - 0 - - -45 - - - - 0 - - - - - 0 - - -46 - - - - 0 - - - - - 0 - - -47 - - - - 0 - - - - - 0 - - -48 - - - - 0 - - - - - 0 - - -49 - - - - 0 - - - - - 0 - - -50 - - - - 0 - - - - - 0 - - -51 - - - - 0 - - - - - 0 - - -52 - - - - 0 - - - - - 0 - - -53 - - - - 0 - - - - - 0 - - -54 - - - - 0 - - - - - 0 - - -55 - - - - 0 - - - - - 0 - - -56 - - - - 0 - - - - - 0 - - -57 - - - - 0 - - - - - 0 - - -58 - - - - 0 - - - - - 0 - - -59 - - - - 0 - - - - - 0 - - -60 - - - - 0 - - - - - 0 - - -61 - - - - 0 - - - - - - - - api - - 63 - - reno_layer - - - - 57 - - - 0 - - -5 - - - - 0 - - - - - 0 - - -6 - - - - 0 - - - - - 0 - - -7 - - - - 0 - - - - - 0 - - -8 - - - - 0 - - - - - 0 - - -9 - - - - 3 - 2 - [@(:include - 1 - - 0 - - -61 - - - 2 - decl:)@] - - - - - 0 - - -10 - - - - 13 - 2 - [@(:include - 1 - - 0 - - -46 - - - 2 - decl:) (:include - 1 - - 0 - - -36 - - - 2 - decl:) (:include - 1 - - 0 - - -47 - - - 2 - decl:) (:include - 1 0 @@ -3461,487 +3536,16 @@ 2 - decl:) (:include + decl pre_indent="4":) (:include 1 0 - -52 + -11 2 - decl:) (:include - 1 - - 0 - - -25 - - - 2 - decl:)@] - - - - - 0 - - -11 - - - - 3 - 2 - [@(:include - 1 - - 0 - - -55 - - - 2 - decl:)@] - - - - - 0 - - -12 - - - - 0 - - - - - 0 - - -13 - - - - 0 - - - - - 0 - - -14 - - - - 0 - - - - - 0 - - -15 - - - - 0 - - - - - 0 - - -18 - - - - 0 - - - - - 0 - - -19 - - - - 0 - - - - - 0 - - -20 - - - - 0 - - - - - 0 - - -21 - - - - 0 - - - - - 0 - - -22 - - - - 0 - - - - - 0 - - -23 - - - - 15 - 2 - [@#include <(:link - 1 - - 0 - - -45 - - - 2 - :)> #include <(:link - 1 - - 0 - - -38 - - - 2 - :)> #include <(:link - 1 - - 0 - - -34 - - - 2 - :)> #include <(:link - 1 - - 0 - - -37 - - - 2 - :)> #include <(:link - 1 - - 0 - - -27 - - - 2 - :)> #include <(:link - 1 - - 0 - - -40 - - - 2 - :)> #include <(:link - 1 - - 0 - - -10 - - - 2 - :)>@] - - - - - 0 - - -24 - - - - 0 - - - - - 0 - - -25 - - - - 0 - - - - - 0 - - -26 - - - - 0 - - - - - 0 - - -27 - - - - 5 - 2 - [@(:include - 1 - - 0 - - -44 - - - 2 - def:) (:include - 1 - - 0 - - -20 - - - 2 - decl:)@] - - - - - 0 - - -28 - - - - 3 - 2 - [@(:include - 1 - - 0 - - -33 - - - 2 - decl:)@] - - - - - 0 - - -29 - - - - 0 - - - - - 0 - - -30 - - - - 0 - - - - - 0 - - -31 - - - - 0 - - - - - 0 - - -32 - - - - 0 - - - - - 0 - - -33 - - - - 0 - - - - - 0 - - -34 - - - - 11 - 2 - [@(:include - 1 - - 0 - - -13 - - - 2 - def:) (:include - 1 - - 0 - - -44 - - - 2 - decl:) typedef (:link - 1 - - 0 - - -44 - - - 2 - :)<struct tag_throw_function,char const *> throw_function; typedef (:link - 1 - - 0 - - -44 - - - 2 - :)<struct tag_throw_file,char const *> throw_file; typedef (:link - 1 - - 0 - - -44 - - - 2 - :)<struct tag_throw_line,int> throw_line;@] - - - - - 0 - - -35 - - - - 0 - - - - - 0 - - -36 - - - - 0 - - - - - 0 - - -37 - - - - 3 - 2 - [@(:include - 1 - - 0 - - -31 - - - 2 - decl:)@] - - - - - 0 - - -38 - - - - 3 - 2 - [@(:include - 1 - - 0 - - -44 - - - 2 - decl:)@] + decl pre_indent="4":) };@] @@ -3955,496 +3559,6 @@ 0 - - - 0 - - -16 - - - - 0 - - - - - 0 - - -39 - - - - 0 - - - - - 0 - - -40 - - - - 3 - 2 - [@(:include - 1 - - 0 - - -6 - - - 2 - decl:)@] - - - - - 0 - - -41 - - - - 5 - 2 - [@(:include - 1 - - 0 - - -32 - - - 2 - decl:) namespace boost { (:include - 1 - - 0 - - -53 - - - 2 - decl:) }@] - - - - - 0 - - -42 - - - - 0 - - - - - 0 - - -43 - - - - 0 - - - - - 0 - - -44 - - - - 0 - - - - - 0 - - -45 - - - - 5 - 2 - [@(:include - 1 - - 0 - - -50 - - - 2 - decl:) (:include - 1 - - 0 - - -18 - - - 2 - decl:)@] - - - - - 0 - - -46 - - - - 0 - - - - - 0 - - -47 - - - - 0 - - - - - 0 - - -48 - - - - 0 - - - - - 0 - - -49 - - - - 0 - - - - - 0 - - -50 - - - - 0 - - - - - 0 - - -51 - - - - 0 - - - - - 0 - - -52 - - - - 0 - - - - - 0 - - -53 - - - - 0 - - - - - 0 - - -54 - - - - 0 - - - - - 0 - - -55 - - - - 0 - - - - - 0 - - -56 - - - - 0 - - - - - 0 - - -57 - - - - 0 - - - - - 0 - - -58 - - - - 0 - - - - - 0 - - -59 - - - - 0 - - - - - 0 - - -60 - - - - 0 - - - - - 0 - - -61 - - - - 0 - - - - - - - - decl - - 64 - - reno_layer - - - - 57 - - - 0 - - -5 - - - - 0 - - - - - 0 - - -6 - - - - 7 - 2 - [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link - 1 - - 0 - - -6 - - - 2 - mod="/":)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link - 1 - - 0 - - -44 - - - 2 - :)<Tag1,T1>, ..., (:link - 1 - - 0 - - -44 - - - 2 - :)<TagN,TN> > const & v );@] - - - - - 0 - - -7 - - - - 0 - - - - - 0 - - -8 - - - - 0 - - - - - 0 - - -9 - - - - 0 - - - - - 0 - - -10 - - - - 0 - - - - - 0 - - -11 - - - - 0 - - - - - 0 - - -12 - - - - 0 - - - - - 0 - - -13 - - - - 3 - 2 - [@class (:link - 1 - - 0 - - -13 - - - 2 - :);@] - - - - - 0 - - -14 - - - - 0 - - - - - 0 - - -15 - - - - 0 - - 0 @@ -4453,18 +3567,7 @@ - 3 - 2 - [@std::string (:link - 1 - - 0 - - -18 - - - 2 - :)();@] + 0 @@ -4486,27 +3589,7 @@ - 5 - 2 - [@template <class E, class Tag, class T> E const & (:link - 1 - - 0 - - -20 - - - 2 - mod="/":)( E const & x, (:link - 1 - - 0 - - -44 - - - 2 - :)<Tag,T> const & v );@] + 0 @@ -4561,27 +3644,7 @@ - 5 - 2 - [@void (:link - 1 - - 0 - - -25 - - - 2 - :)( (:link - 1 - - 0 - - -47 - - - 2 - :) const & ep ); + 0 @@ -4592,7 +3655,27 @@ - 0 + 5 + 2 + [@typedef + 1 + + 0 + + -67 + + + 2 + <struct errinfo_api_function_,int> + 1 + + 0 + + -26 + + + 2 + ;@] @@ -4636,27 +3719,7 @@ - 5 - 2 - [@(:link - 1 - - 0 - - -43 - - - 2 - mod="m":) const & (:link - 1 - - 0 - - -30 - - - 2 - mod="m":)() const;@] + 0 @@ -4667,27 +3730,7 @@ - 5 - 2 - [@template <class ErrorInfo,class E> typename ErrorInfo::(:link - 1 - - 0 - - -43 - - - 2 - mod="m":) const * (:link - 1 - - 0 - - -31 - - - 2 - :)( E const & x );@] + 0 @@ -4698,18 +3741,18 @@ - 19 + 5 2 - [@#if !defined( BOOST_EXCEPTION_DISABLE ) #include <(:link + [@typedef 1 0 - -34 + -67 2 - :)> #include <boost/current_function.hpp> #define (:link + <struct errinfo_errno_,int> 1 0 @@ -4718,70 +3761,7 @@ 2 - :)(x)\ ::boost::(:link - 1 - - 0 - - -53 - - - 2 - :)( ::boost::(:link - 1 - - 0 - - -33 - - - 2 - :)(x) <<\ ::boost::(:link - 1 - - 0 - - -34 - - - 2 - |throw_function:)(BOOST_CURRENT_FUNCTION) <<\ ::boost::(:link - 1 - - 0 - - -34 - - - 2 - |throw_file:)(__FILE__) <<\ ::boost::(:link - 1 - - 0 - - -34 - - - 2 - |throw_line:)((int)__LINE__) ) #else #define (:link - 1 - - 0 - - -32 - - - 2 - :)(x) ::boost::(:link - 1 - - 0 - - -53 - - - 2 - :)(x) #endif@] + ;@] @@ -4792,18 +3772,7 @@ - 3 - 2 - [@template <class T> ---unspecified--- (:link - 1 - - 0 - - -33 - - - 2 - :)( T const & x );@] + 0 @@ -4825,36 +3794,7 @@ - 7 - 2 - [@(:link - 1 - - 0 - - -35 - - - 2 - mod="m":)(); (:link - 1 - - 0 - - -35 - - - 2 - mod="m":)( (:link - 1 - - 0 - - -13 - - - 2 - :) const & x );@] + 0 @@ -4867,16 +3807,16 @@ 5 2 - [@typedef (:link + [@typedef 1 0 - -44 + -67 2 - :)<struct tag_original_exception_type,std::type_info const *> + <struct errinfo_file_handle_,weak_ptr<FILE> > 1 0 @@ -4910,28 +3850,6 @@ 0 - - - 0 - - -17 - - - - 0 - - - - - 0 - - -16 - - - - 0 - - 0 @@ -4973,27 +3891,7 @@ - 5 - 2 - [@template <class T> (:link - 1 - - 0 - - -47 - - - 2 - :) (:link - 1 - - 0 - - -42 - - - 2 - :)( T const & e );@] + 0 @@ -5004,18 +3902,7 @@ - 3 - 2 - [@typedef T (:link - 1 - - 0 - - -43 - - - 2 - mod="m":);@] + 0 @@ -5026,18 +3913,7 @@ - 3 - 2 - [@template <class Tag,class T> class (:link - 1 - - 0 - - -44 - - - 2 - :);@] + 0 @@ -5055,64 +3931,31 @@ 0 - -46 + -48 5 2 - [@class (:link + [@typedef 1 0 - -46 + -67 2 - :): public std::exception public boost:: + <struct errinfo_type_info_name_,std::string> 1 0 - -13 + -48 2 - { ---unspecified--- };@] - - - - - 0 - - -47 - - - - 3 - 2 - [@typedef ---unspecified--- (:link - 1 - - 0 - - -47 - - - 2 - :);@] - - - - - 0 - - -48 - - - - 0 + ;@] @@ -5134,36 +3977,18 @@ - 7 - 2 - [@template <class E> std::string (:link - 1 - - 0 - - -50 - - - 2 - :)( E const & e ); std::string (:link - 1 - - 0 - - -50 - - - 2 - :)( - 1 - - 0 - - -47 - - - 2 - const & p );@] + 0 + + + + + 0 + + -46 + + + + 0 @@ -5185,27 +4010,7 @@ - 5 - 2 - [@(:link - 1 - - 0 - - -47 - - - 2 - :) (:link - 1 - - 0 - - -52 - - - 2 - :)();@] + 0 @@ -5216,27 +4021,18 @@ - 5 - 2 - [@#ifdef BOOST_NO_EXCEPTIONS void (:link - 1 - - 0 - - -53 - - - 2 - :)( std::exception const & e ); // user defined #else template <class E> void (:link - 1 - - 0 - - -53 - - - 2 - :)( E const & e ); #endif@] + 0 + + + + + 0 + + -47 + + + + 0 @@ -5247,18 +4043,7 @@ - 3 - 2 - [@(:link - 1 - - 0 - - -54 - - - 2 - mod="m":)();@] + 0 @@ -5269,9 +4054,18 @@ - 3 + 5 2 - [@template <class T> ---unspecified--- (:link + [@typedef + 1 + + 0 + + -67 + + + 2 + <struct errinfo_file_name_,std::string> 1 0 @@ -5280,7 +4074,7 @@ 2 - :)( T const & e );@] + ;@] @@ -5313,27 +4107,7 @@ - 5 - 2 - [@(:link - 1 - - 0 - - -58 - - - 2 - mod="m":)( (:link - 1 - - 0 - - -43 - - - 2 - mod="m":) const & v );@] + 0 @@ -5365,10 +4139,510 @@ -61 + + 0 + + + + + 0 + + -62 + + + + 0 + + + + + 0 + + -63 + + + + 0 + + + + + 0 + + -64 + + + + 0 + + + + + 0 + + -65 + + + + 5 + 2 + [@typedef + 1 + + 0 + + -67 + + + 2 + <struct errinfo_at_line_,int> + 1 + + 0 + + -65 + + + 2 + ;@] + + + + + 0 + + -66 + + + + 5 + 2 + [@typedef + 1 + + 0 + + -67 + + + 2 + <struct errinfo_file_open_mode_,std::string> + 1 + + 0 + + -66 + + + 2 + ;@] + + + + + 0 + + -67 + + + + 9 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -67 + + + 2 + :) { public: (:include + 1 + + 0 + + -30 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -18 + + + 2 + decl pre_indent="4":) (:include + 1 + + 0 + + -40 + + + 2 + decl pre_indent="4":) };@] + + + + + 0 + + -68 + + + + 0 + + + + + 0 + + -69 + + + + 0 + + + + + 0 + + -70 + + + + 0 + + + + + 0 + + -71 + + + + 0 + + + + + 0 + + -72 + + + + 0 + + + + + 0 + + -73 + + + + 0 + + + + + 0 + + -74 + + + + 0 + + + + + 0 + + -75 + + + + 0 + + + + + 0 + + -76 + + + + 0 + + + + + 0 + + -77 + + + + 0 + + + + + + + + api + + 79 + + reno_layer + + + + 73 + + + 0 + + -5 + + + + 0 + + + + + 0 + + -6 + + + + 0 + + + + + 0 + + -7 + + + + 0 + + + + + 0 + + -8 + + + + 0 + + + + + 0 + + -9 + + + + 13 + 2 + [@(:include + 1 + + 0 + + -31 + + + 2 + decl:) (:include + 1 + + 0 + + -8 + + + 2 + decl:) (:include + 1 + + 0 + + -53 + + + 2 + decl:) (:include + 1 + + 0 + + -13 + + + 2 + decl:) (:include + 1 + + 0 + + -17 + + + 2 + decl:) (:include + 1 + + 0 + + -33 + + + 2 + decl:)@] + + + + + 0 + + -10 + + + + 0 + + + + + 0 + + -11 + + + + 0 + + + + + 0 + + -12 + + 3 2 - [@template <class E> E * + [@(:include + 1 + + 0 + + -65 + + + 2 + def:)@] + + + + + 0 + + -13 + + + + 0 + + + + + 0 + + -14 + + + + 0 + + + + + 0 + + -15 + + + + 0 + + + + + 0 + + -16 + + + + 0 + + + + + 0 + + -17 + + + + 0 + + + + + 0 + + -18 + + + + 0 + + + + + 0 + + -19 + + + + 5 + 2 + [@(:include 1 0 @@ -5377,9 +4651,2289 @@ 2 + decl:) (:include + 1 + + 0 + + -50 + + + 2 + decl:)@] + + + + + 0 + + -20 + + + + 0 + + + + + 0 + + -21 + + + + 0 + + + + + 0 + + -22 + + + + 0 + + + + + 0 + + -23 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -36 + + + 2 + def:)@] + + + + + 0 + + -24 + + + + 0 + + + + + 0 + + -25 + + + + 0 + + + + + 0 + + -26 + + + + 0 + + + + + 0 + + -27 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -56 + + + 2 + decl:)@] + + + + + 0 + + -28 + + + + 0 + + + + + 0 + + -29 + + + + 0 + + + + + 0 + + -30 + + + + 0 + + + + + 0 + + -31 + + + + 0 + + + + + 0 + + -32 + + + + 0 + + + + + 0 + + -33 + + + + 0 + + + + + 0 + + -34 + + + + 0 + + + + + 0 + + -35 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -22 + + + 2 + decl:)@] + + + + + 0 + + -36 + + + + 0 + + + + + 0 + + -37 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -28 + + + 2 + decl:)@] + + + + + 0 + + -38 + + + + 0 + + + + + 0 + + -39 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -26 + + + 2 + def:)@] + + + + + 0 + + -40 + + + + 0 + + + + + 0 + + -41 + + + + 0 + + + + + 0 + + -42 + + + + 0 + + + + + 0 + + -43 + + + + 0 + + + + + 0 + + -44 + + + + 0 + + + + + 0 + + -45 + + + + 0 + + + + + 0 + + -48 + + + + 0 + + + + + 0 + + -49 + + + + 0 + + + + + 0 + + -50 + + + + 0 + + + + + 0 + + -46 + + + + 0 + + + + + 0 + + -51 + + + + 29 + 2 + [@#include <(:link + 1 + + 0 + + -19 + + + 2 + :)> #include <(:link + 1 + + 0 + + -60 + + + 2 + :)> #include <(:link + 1 + + 0 + + -64 + + + 2 + :)> #include <(:link + 1 + + 0 + + -27 + + + 2 + :)> #include <(:link + 1 + + 0 + + -71 + + + 2 + :)> #include <(:link + 1 + + 0 + + -73 + + + 2 + :)> #include <(:link + 1 + + 0 + + -9 + + + 2 + :)> #include <(:link + 1 + + 0 + + -39 + + + 2 + :)> #include <(:link + 1 + + 0 + + -12 + + + 2 + :)> #include <(:link + 1 + + 0 + + -63 + + + 2 + :)> #include <(:link + 1 + + 0 + + -23 + + + 2 + :)> #include <(:link + 1 + + 0 + + -70 + + + 2 + :)> #include <(:link + 1 + + 0 + + -58 + + + 2 + :)> #include <(:link + 1 + + 0 + + -72 + + + 2 + :)>@] + + + + + 0 + + -52 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -6 + + + 2 + decl:)@] + + + + + 0 + + -53 + + + + 0 + + + + + 0 + + -47 + + + + 0 + + + + + 0 + + -54 + + + + 5 + 2 + [@(:include + 1 + + 0 + + -49 + + + 2 + decl:) namespace boost { (:include + 1 + + 0 + + -57 + + + 2 + decl:) }@] + + + + + 0 + + -55 + + + + 0 + + + + + 0 + + -56 + + + + 0 + + + + + 0 + + -57 + + + + 0 + + + + + 0 + + -58 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -66 + + + 2 + def:)@] + + + + + 0 + + -59 + + + + 0 + + + + + 0 + + -60 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -67 + + + 2 + decl:)@] + + + + + 0 + + -61 + + + + 0 + + + + + 0 + + -62 + + + + 0 + + + + + 0 + + -63 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -32 + + + 2 + def:)@] + + + + + 0 + + -64 + + + + 11 + 2 + [@(:include + 1 + + 0 + + -16 + + + 2 + def:) (:include + 1 + + 0 + + -67 + + + 2 + decl:) typedef (:link + 1 + + 0 + + -67 + + + 2 + :)<struct throw_function_,char const *> throw_function; typedef (:link + 1 + + 0 + + -67 + + + 2 + :)<struct throw_file_,char const *> throw_file; typedef (:link + 1 + + 0 + + -67 + + + 2 + :)<struct throw_line_,int> throw_line;@] + + + + + 0 + + -65 + + + + 0 + + + + + 0 + + -66 + + + + 0 + + + + + 0 + + -67 + + + + 0 + + + + + 0 + + -68 + + + + 0 + + + + + 0 + + -69 + + + + 0 + + + + + 0 + + -70 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -55 + + + 2 + def:)@] + + + + + 0 + + -71 + + + + 5 + 2 + [@(:include + 1 + + 0 + + -67 + + + 2 + def:) (:include + 1 + + 0 + + -43 + + + 2 + decl:)@] + + + + + 0 + + -72 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -48 + + + 2 + def:)@] + + + + + 0 + + -73 + + + + 3 + 2 + [@(:include + 1 + + 0 + + -41 + + + 2 + decl:)@] + + + + + 0 + + -74 + + + + 0 + + + + + 0 + + -75 + + + + 0 + + + + + 0 + + -76 + + + + 0 + + + + + 0 + + -77 + + + + 0 + + + + + + + + decl + + 80 + + reno_layer + + + + 73 + + + 0 + + -5 + + + + 0 + + + + + 0 + + -6 + + + + 3 + 2 + [@template <class T> ---unspecified--- (:link + 1 + + 0 + + -6 + + + 2 + :)( T const & x );@] + + + + + 0 + + -7 + + + + 0 + + + + + 0 + + -8 + + + + 5 + 2 + [@typedef (:link + 1 + + 0 + + -67 + + + 2 + :)<struct tag_original_exception_type,std::type_info const *> + 1 + + 0 + + -8 + + + 2 + ;@] + + + + + 0 + + -9 + + + + 0 + + + + + 0 + + -10 + + + + 0 + + + + + 0 + + -11 + + + + 3 + 2 + [@(:link + 1 + + 0 + + -11 + + + 2 + mod="m":)();@] + + + + + 0 + + -12 + + + + 0 + + + + + 0 + + -13 + + + + 5 + 2 + [@template <class T> (:link + 1 + + 0 + + -53 + + + 2 + :) (:link + 1 + + 0 + + -13 + + + 2 + :)( T const & e );@] + + + + + 0 + + -14 + + + + 0 + + + + + 0 + + -15 + + + + 0 + + + + + 0 + + -16 + + + + 3 + 2 + [@class (:link + 1 + + 0 + + -16 + + + 2 + :);@] + + + + + 0 + + -17 + + + + 5 + 2 + [@(:link + 1 + + 0 + + -53 + + + 2 + :) (:link + 1 + + 0 + + -17 + + + 2 + :)();@] + + + + + 0 + + -18 + + + + 5 + 2 + [@(:link + 1 + + 0 + + -18 + + + 2 + mod="m":)( (:link + 1 + + 0 + + -30 + + + 2 + mod="m":) const & v );@] + + + + + 0 + + -19 + + + + 0 + + + + + 0 + + -20 + + + + 0 + + + + + 0 + + -21 + + + + 0 + + + + + 0 + + -22 + + + + 3 + 2 + [@template <class E> E * + 1 + + 0 + + -22 + + + 2 ();@] + + + 0 + + -23 + + + + 0 + + + + + 0 + + -24 + + + + 0 + + + + + 0 + + -25 + + + + 0 + + + + + 0 + + -26 + + + + 0 + + + + + 0 + + -27 + + + + 0 + + + + + 0 + + -28 + + + + 3 + 2 + [@template <class T> ---unspecified--- (:link + 1 + + 0 + + -28 + + + 2 + :)( T const & e );@] + + + + + 0 + + -29 + + + + 0 + + + + + 0 + + -30 + + + + 3 + 2 + [@typedef T (:link + 1 + + 0 + + -30 + + + 2 + mod="m":);@] + + + + + 0 + + -31 + + + + 5 + 2 + [@class (:link + 1 + + 0 + + -31 + + + 2 + :): public std::exception public boost:: + 1 + + 0 + + -16 + + + 2 + { ---unspecified--- };@] + + + + + 0 + + -32 + + + + 0 + + + + + 0 + + -33 + + + + 5 + 2 + [@void (:link + 1 + + 0 + + -33 + + + 2 + :)( (:link + 1 + + 0 + + -53 + + + 2 + :) const & ep ); + + + + + 0 + + -34 + + + + 0 + + + + + 0 + + -35 + + + + 0 + + + + + 0 + + -36 + + + + 0 + + + + + 0 + + -37 + + + + 0 + + + + + 0 + + -38 + + + + 0 + + + + + 0 + + -39 + + + + 0 + + + + + 0 + + -40 + + + + 5 + 2 + [@(:link + 1 + + 0 + + -30 + + + 2 + mod="m":) const & (:link + 1 + + 0 + + -40 + + + 2 + mod="m":)() const;@] + + + + + 0 + + -41 + + + + 7 + 2 + [@template <class E, class Tag1, class T1, ..., class TagN, class TN> E const & (:link + 1 + + 0 + + -41 + + + 2 + mod="/":)( E const & x, (:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)< (:link + 1 + + 0 + + -67 + + + 2 + :)<Tag1,T1>, ..., (:link + 1 + + 0 + + -67 + + + 2 + :)<TagN,TN> > const & v );@] + + + + + 0 + + -42 + + + + 7 + 2 + [@(:link + 1 + + 0 + + -42 + + + 2 + mod="m":)(); (:link + 1 + + 0 + + -42 + + + 2 + mod="m":)( (:link + 1 + + 0 + + -16 + + + 2 + :) const & x );@] + + + + + 0 + + -43 + + + + 5 + 2 + [@template <class E, class Tag, class T> E const & (:link + 1 + + 0 + + -43 + + + 2 + mod="/":)( E const & x, (:link + 1 + + 0 + + -67 + + + 2 + :)<Tag,T> const & v );@] + + + + + 0 + + -44 + + + + 0 + + + + + 0 + + -45 + + + + 0 + + + + + 0 + + -48 + + + + 0 + + + + + 0 + + -49 + + + + 19 + 2 + [@#if !defined( BOOST_EXCEPTION_DISABLE ) #include <(:link + 1 + + 0 + + -64 + + + 2 + :)> #include <boost/current_function.hpp> #define (:link + 1 + + 0 + + -49 + + + 2 + :)(x)\ ::boost::(:link + 1 + + 0 + + -57 + + + 2 + :)( ::boost::(:link + 1 + + 0 + + -6 + + + 2 + :)(x) <<\ ::boost::(:link + 1 + + 0 + + -64 + + + 2 + |throw_function:)(BOOST_CURRENT_FUNCTION) <<\ ::boost::(:link + 1 + + 0 + + -64 + + + 2 + |throw_file:)(__FILE__) <<\ ::boost::(:link + 1 + + 0 + + -64 + + + 2 + |throw_line:)((int)__LINE__) ) #else #define (:link + 1 + + 0 + + -49 + + + 2 + :)(x) ::boost::(:link + 1 + + 0 + + -57 + + + 2 + :)(x) #endif@] + + + + + 0 + + -50 + + + + 3 + 2 + [@std::string (:link + 1 + + 0 + + -50 + + + 2 + :)();@] + + + + + 0 + + -46 + + + + 0 + + + + + 0 + + -51 + + + + 0 + + + + + 0 + + -52 + + + + 0 + + + + + 0 + + -53 + + + + 3 + 2 + [@typedef ---unspecified--- (:link + 1 + + 0 + + -53 + + + 2 + :);@] + + + + + 0 + + -47 + + + + 0 + + + + + 0 + + -54 + + + + 0 + + + + + 0 + + -55 + + + + 0 + + + + + 0 + + -56 + + + + 5 + 2 + [@template <class ErrorInfo,class E> typename ErrorInfo::(:link + 1 + + 0 + + -30 + + + 2 + mod="m":) const * (:link + 1 + + 0 + + -56 + + + 2 + :)( E const & x );@] + + + + + 0 + + -57 + + + + 5 + 2 + [@#ifdef BOOST_NO_EXCEPTIONS void (:link + 1 + + 0 + + -57 + + + 2 + :)( std::exception const & e ); // user defined #else template <class E> void (:link + 1 + + 0 + + -57 + + + 2 + :)( E const & e ); #endif@] + + + + + 0 + + -58 + + + + 0 + + + + + 0 + + -59 + + + + 0 + + + + + 0 + + -60 + + + + 0 + + + + + 0 + + -61 + + + + 7 + 2 + [@template <class E> std::string (:link + 1 + + 0 + + -61 + + + 2 + :)( E const & e ); std::string (:link + 1 + + 0 + + -61 + + + 2 + :)( + 1 + + 0 + + -53 + + + 2 + const & p );@] + + + + + 0 + + -62 + + + + 0 + + + + + 0 + + -63 + + + + 0 + + + + + 0 + + -64 + + + + 0 + + + + + 0 + + -65 + + + + 0 + + + + + 0 + + -66 + + + + 0 + + + + + 0 + + -67 + + + + 3 + 2 + [@template <class Tag,class T> class (:link + 1 + + 0 + + -67 + + + 2 + :);@] + + + + + 0 + + -68 + + + + 0 + + + + + 0 + + -69 + + + + 0 + + + + + 0 + + -70 + + + + 0 + + + + + 0 + + -71 + + + + 0 + + + + + 0 + + -72 + + + + 0 + + + + + 0 + + -73 + + + + 0 + + + + + 0 + + -74 + + + + 0 + + + + + 0 + + -75 + + + + 0 + + + + + 0 + + -76 + + + + 0 + + + + + 0 + + -77 + + + + 0 + + @@ -5387,13 +6941,13 @@ include - 65 + 81 reno_layer - 57 + 73 0 @@ -5402,126 +6956,27 @@ - 27 + 5 2 - (:auto !!:) Some exception hierarchies can not be modified to make boost::(:link + (:auto !!!:) Exception types should use virtual inheritance when deriving from other exception types. This insight is due to Andrew Koenig. Using virtual inheritance prevents ambiguity problems in the exception handler: [@#include <iostream> struct my_exc1 : std::exception { char const* what() const throw(); }; struct my_exc2 : std::exception { char const* what() const throw(); }; struct your_exc3 : my_exc1, my_exc2 {}; int main() { try { throw your_exc3(); } catch(std::exception const& e) {} catch(...) { std::cout << "whoops!" << std::endl; } }@] The program above outputs "whoops!" because the conversion to std::exception is ambiguous. The overhead introduced by virtual inheritance is always negligible in the context of exception handling. Note that virtual bases are initialized directly by the constructor of the most-derived-type (the type passed to the throw statement, in case of exceptions.) However, typically this detail is of no concern when boost::(:link 1 0 - -13 + -16 2 - :) a base type. In this case, the (:link + :) is used, because it enables exception types to be trivial structs with no members (there's nothing to initialize.) See (:link 1 0 - -33 + -46 2 - :) function template can be used to make exception objects derive from boost::(:link - 1 - - 0 - - -13 - - - 2 - :) anyway. Here is an example: [@#include <(:link - 1 - - 0 - - -23 - - - 2 - :)> #include <stdexcept> typedef boost::(:link - 1 - - 0 - - -44 - - - 2 - :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link - 1 - - 0 - - -44 - - - 2 - :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link - 1 - - 0 - - -44 - - - 2 - :)<struct tag_std_range_index,size_t> std_range_index; template <class T> class my_container { public: size_t size() const; T const & operator[]( size_t i ) const { if( i > size() ) throw boost::(:link - 1 - - 0 - - -33 - - - 2 - :)(std::range_error("Index out of range")) << std_range_min(0) << std_range_max(size()) << std_range_index(i); //.... } }; @] The call to (:link - 1 - - 0 - - -33 - - - 2 - :)<T> gets us an object of ''unspecified type'' which is guaranteed to derive from both boost::(:link - 1 - - 0 - - -13 - - - 2 - :) and T. This makes it possible to use (:link - 1 - - 0 - - -20 - - - 2 - mod="/":) to store additional information in the exception object. The exception can be intercepted as T &, so existing exception handling will not break. It can also be intercepted as boost::(:link - 1 - - 0 - - -13 - - - 2 - :) &, so that (:link - 1 - - 0 - - -14 - - - 2 - |more information can be added to the exception at a later time:). + mod="w":). @@ -5534,25 +6989,25 @@ 5 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: T must be a class with an accessible no-throw copy constructor as per (15.5.1). !!!!Returns: * If T derives from boost::(:link 1 0 - -13 + -16 2 - :), or a type that derives (indirectly) from boost::(:link + :), the returned object is of type T and is a copy of x. * Otherwise, the returned object is of an unspecified type that derives publicly from both T and boost::(:link 1 0 - -13 + -16 2 - :). !!!!Effects: Equivalent to x << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<0>() << ... << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<N>(). !!!!Returns: x. (:include throws:) + :). The T sub-object is initialized from x by the T copy constructor. !!!!Throws: Nothing. @@ -5563,90 +7018,54 @@ - 19 + 11 2 - (:auto !!!:) Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Let's say we have an exception type file_read_error, which takes a file name in its constructor. Consider the following function: [@void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error(????); }@] How can the file_read function pass a file name to the exception type constructor? All it has is a FILE handle. Using boost::(:link + !!!!Example: this is a possible output from the (:link 1 0 - -13 + -61 2 - :) allows us to free the file_read function from the burden of storing the file name in exceptions it throws: [@#include <(:link + :) 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::(:link 1 0 - -23 + -26 2 - :)> #include <stdio.h> #include <errno.h> typedef boost::(:link + :)_ *] = fopen [struct boost::(:link 1 0 - -44 + -32 2 - :)<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link + :)_ *] = 2, "No such file or directory" [struct boost::(:link 1 0 - -13 + -55 2 - :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error() << errno_info(errno); }@] If file_read detects a failure, it throws an exception which contains the information that is available at the time, namely the errno. Other relevant information, such as the file name, can be added in a context higher up the call stack, where it is known naturally: [@#include <(:link + :)_ *] = tmp1.txt [struct boost::(:link 1 0 - -23 + -66 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> typedef boost::(:link - 1 - - 0 - - -44 - - - 2 - :)<struct tag_file_name,std::string> file_name_info; boost::shared_ptr<FILE> file_open( char const * file_name, char const * mode ); void file_read( FILE * f, void * buffer, size_t size ); void parse_file( char const * file_name ) { boost::shared_ptr<FILE> f = file_open(file_name,"rb"); assert(f); try { char buf[1024]; file_read( f.get(), buf, sizeof(buf) ); } catch( boost::(:link - 1 - - 0 - - -13 - - - 2 - :) & e ) { e << file_name_info(file_name); throw; } }@] The above function is (almost) exception-neutral -- if an exception is emitted by any function call within the try block, parse_file does not need to do any real work, but it intercepts any boost::(:link - 1 - - 0 - - -13 - - - 2 - :) object, stores the file name, and re-throws using a throw-expression with no operand (15.1.6). The rationale for catching any boost::(:link - 1 - - 0 - - -13 - - - 2 - :) object is that the file name is relevant to any failure that occurs in parse_file, ''even if the failure is unrelated to file I/O''. + :)_ *] = rb@] @@ -5657,9 +7076,45 @@ - 1 + 9 2 - (:auto !:) This is an alphabetical list of all Boost Exception documentation pages. (:pagelist fmt="index" except_tags="index noindex" mod="w":) + (:auto !!!:) (:include synopsis:) This + 1 + + 0 + + -67 + + + 2 + typedef is used by + 1 + + 0 + + -17 + + + 2 + if it defaults to returning an + 1 + + 0 + + -53 + + + 2 + that refers to an object of type + 1 + + 0 + + -31 + + + 2 + , to record in it the std::type_info of the original exception object. @@ -5682,6 +7137,122 @@ -10 + + 19 + 2 + (:auto !!!:) The code snippet below demonstrates how boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) can be used to bundle the name of the function that failed, together with the reported errno so that they can be added to exception objects more conveniently together: [@#include <(:link + 1 + + 0 + + -73 + + + 2 + :)> #include <(:link + 1 + + 0 + + -70 + + + 2 + :)> #include <(:link + 1 + + 0 + + -39 + + + 2 + :)> #include <(:link + 1 + + 0 + + -63 + + + 2 + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:)<boost::(:link + 1 + + 0 + + -26 + + + 2 + :),boost::(:link + 1 + + 0 + + -32 + + + 2 + :)> clib_failure; struct file_open_error: virtual boost::(:link + 1 + + 0 + + -16 + + + 2 + :) { }; boost::shared_ptr<FILE> file_open( char const * name, char const * mode ) { if( FILE * f=fopen(name,mode) ) return boost::shared_ptr<FILE>(f,fclose); else throw file_open_error() << boost::(:link + 1 + + 0 + + -55 + + + 2 + :)(name) << clib_failure("fopen",errno); }@] Note that the members of a boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) are stored separately in exception objects; they can only be retrieved individually, using (:link + 1 + + 0 + + -56 + + + 2 + :). + + + + + 0 + + -11 + + + + 3 + 2 + (:auto !!!:) (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link + 1 + + 0 + + -16 + + + 2 + :) object. !!!!Throws: Nothing. + + + + + 0 + + -12 + + 1 2 @@ -5692,7 +7263,1300 @@ 0 - -11 + -13 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw + 1 + + 0 + + -28 + + + 2 + (e); } catch(...) { return (:link + 1 + + 0 + + -17 + + + 2 + :)(); }@] + + + + + 0 + + -14 + + + + 1 + 2 + (:auto !:) This is an alphabetical list of all Boost Exception documentation pages. (:pagelist fmt="index" except_tags="index noindex" mod="w":) + + + + + 0 + + -15 + + + + 79 + 2 + (:auto !!:) !!!Why doesn't boost::exception derive from std::exception? Despite that (:link + 1 + + 0 + + -5 + + + 2 + |virtual inheritance should be used in deriving from base exception types:), many programmers fail to follow this principle when deriving from std::exception. If boost::(:link + 1 + + 0 + + -16 + + + 2 + :) derives from std::exception, using the (:link + 1 + + 0 + + -6 + + + 2 + :) function with such user-defined types would introduce dangerous ambiguity which would break all catch(std::exception &) statements. Of course, boost::(:link + 1 + + 0 + + -16 + + + 2 + :) should not be used to replace std::exception as a base type in exception type hierarchies. Instead, it should be included as a virtual base, in addition to std::exception (which should also be derived virtually.) !!!Why is boost::exception abstract? To prevent exception-neutral contexts from erroneously erasing the type of the original exception when adding (:link + 1 + + 0 + + -67 + + + 2 + :) to an active exception object: [@catch( boost::(:link + 1 + + 0 + + -16 + + + 2 + :) & e ) { e (:link + 1 + + 0 + + -43 + + + 2 + |<<:) foo_info(foo); throw e; //Compile error: boost::(:link + 1 + + 0 + + -16 + + + 2 + :) is abstract }@] The correct code is: [@catch( boost::(:link + 1 + + 0 + + -16 + + + 2 + :) & e ) { e (:link + 1 + + 0 + + -43 + + + 2 + |<<:) foo_info(foo); throw; //Okay, re-throwing the original exception object. }@] !!!What is the space overhead of the boost::exception base class? The space overhead for the boost::exception data members is negligible in the context of exception handling. Throwing objects that derive from boost::(:link + 1 + + 0 + + -16 + + + 2 + :) does not by itself cause dynamic memory allocations. Deriving from boost::(:link + 1 + + 0 + + -16 + + + 2 + :) enables any data to be added to exceptions, which usually does allocate memory. However, this memory is reclaimed when the exception has been handled, and since typically user code does not allocate memory during the unrolling of the stack, adding error info to exceptions should not cause memory fragmentation. !!!Should I use boost::throw_exception or BOOST_THROW_EXCEPTION or just throw? The benefit of calling boost::(:link + 1 + + 0 + + -57 + + + 2 + :) instead of using throw directly is that it ensures that the emitted exception derives from boost::(:link + 1 + + 0 + + -16 + + + 2 + :) and that it is compatible with boost::(:link + 1 + + 0 + + -17 + + + 2 + :). The (:link + 1 + + 0 + + -49 + + + 2 + :) macro also results in a call to boost::(:link + 1 + + 0 + + -57 + + + 2 + :), but in addition it records in the exception object the __FILE__ and __LINE__ of the throw, as well as the pretty name of the function that throws. This has virtually no overhead, yet enables boost::(:link + 1 + + 0 + + -61 + + + 2 + :) to compose a more useful, if not user-friendly message. Typical use of boost::(:link + 1 + + 0 + + -61 + + + 2 + :) is: [@catch( boost::exception & e ) { std::cerr << "OMG!" << boost::diagnostic_information(e); } catch( ... ) { std::cerr << "OMG!!!"; }@] This is a possible message it may display, the first line is only possible if (:link + 1 + + 0 + + -49 + + + 2 + :) is used: [@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<class fopen_error> std::exception::what: example_io error [struct boost::(:link + 1 + + 0 + + -26 + + + 2 + :)_ *] = fopen [struct boost::(:link + 1 + + 0 + + -32 + + + 2 + :)_ *] = 2, "No such file or directory" [struct boost::(:link + 1 + + 0 + + -55 + + + 2 + :)_ *] = tmp1.txt [struct boost::(:link + 1 + + 0 + + -66 + + + 2 + :)_ *] = rb@] !!!Why is boost::exception integrated in boost::throw_exception? The boost::(:link + 1 + + 0 + + -57 + + + 2 + :) function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::(:link + 1 + + 0 + + -16 + + + 2 + :) as a base of any exception passed to boost::(:link + 1 + + 0 + + -57 + + + 2 + :). Such concerns are dictated by the typical strict interpretation of a common principle in C and C++, that users only pay for features they actually use. The problem is that users of Boost Exception can't by themselves cause a library to throw types that derive from boost::(:link + 1 + + 0 + + -16 + + + 2 + :), and without this they can't use any of the Boost Exception facilities. For example, if a user wants to use Boost Serialization in a separate thread, it is desirable to be able to transport exceptions emitted by that library into the main thread where they can be analyzed to generate a user-friendly message. This can be easily achieved using boost::(:link + 1 + + 0 + + -53 + + + 2 + :), but this requires that Boost Serialization throws exceptions using boost::(:link + 1 + + 0 + + -28 + + + 2 + :). If Boost Serialization calls boost::(:link + 1 + + 0 + + -57 + + + 2 + :) to throw, this behavior happens automatically and transparently. The cost of this integration is: * In terms of space: a pointer and 3 ints are added to the static size of exception objects. * In terms of speed: the pointer is initialized to null at the point of the throw. * In terms of coupling: about 400 self-contained lines of C++ with no external includes. !!!Why use operator<< overload for adding info to exceptions? Before throwing an object of type that derives from boost::(:link + 1 + + 0 + + -16 + + + 2 + :), it is often desirable to add one or more (:link + 1 + + 0 + + -67 + + + 2 + :) objects in it. The syntactic sugar provided by (:link + 1 + + 0 + + -43 + + + 2 + :) allows this to be done directly in a throw expression: [@throw error() (:link + 1 + + 0 + + -43 + + + 2 + |<<:) foo_info(foo) (:link + 1 + + 0 + + -43 + + + 2 + |<<:) bar_info(bar);@] which saves typing compared to this possible alternative: [@error e; e.add(foo_info(foo)); e.add(bar_info(bar)); throw e;@] and looks better than something like: [@throw error().add(foo_info(foo)).add(bar_info(bar));@] !!!Why is operator<< allowed to throw? This question is referring to the following issue. Consider this throw statement example: [@throw file_open_error() (:link + 1 + + 0 + + -43 + + + 2 + |<<:) file_name(fn);@] The intention here is to throw a file_open_error, however if (:link + 1 + + 0 + + -43 + + + 2 + mod="/":) fails to copy the std::string contained in the file_name (:link + 1 + + 0 + + -67 + + + 2 + :) wrapper, a std::bad_alloc could propagate instead. This behavior seems undesirable to some programmers. Bjarne Stroustrup, The C++ Programming Language, 3rd Edition, page 371: ->''"Throwing an exception requires an object to throw. A C++ implementation is required to have enough spare memory to be able to throw bad_alloc in case of memory exhaustion. However, it is possible that throwing some other exception will cause memory exhaustion."'' So, an attempt to throw any exception may already result in propagating std::bad_alloc instead. + + + + + 0 + + -16 + + + + 13 + 2 + (:auto !!!:) (:include synopsis:) Class boost::(:link + 1 + + 0 + + -16 + + + 2 + :) is designed to be used as a universal base for user-defined exception types. An object of any type deriving from boost::(:link + 1 + + 0 + + -16 + + + 2 + :) can store data of arbitrary types, using the (:link + 1 + + 0 + + -67 + + + 2 + :) wrapper and (:link + 1 + + 0 + + -43 + + + 2 + mod="/":). To retrieve data from a boost::(:link + 1 + + 0 + + -16 + + + 2 + :) object, use the (:link + 1 + + 0 + + -56 + + + 2 + :) function template. + + + + + 0 + + -17 + + + + 33 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: The (:link + 1 + + 0 + + -17 + + + 2 + :) function must not be called outside of a catch block. !!!!Returns: * An (:link + 1 + + 0 + + -53 + + + 2 + :) that refers to the currently handled exception or a copy of the currently handled exception. * If the function needs to allocate memory and the attempt fails, it returns an (:link + 1 + + 0 + + -53 + + + 2 + :) that refers to an instance of std::bad_alloc. !!!!Throws: Nothing. !!!!Notes: * It is unspecified whether the return values of two successive calls to (:link + 1 + + 0 + + -17 + + + 2 + :) refer to the same exception object. * Correct implementation of (:link + 1 + + 0 + + -17 + + + 2 + :) may require compiler support, unless (:link + 1 + + 0 + + -28 + + + 2 + :) was used at the time the currently handled exception object was passed to throw. Whenever + 1 + + 0 + + -17 + + + 2 + fails to properly copy the current exception object, it returns an + 1 + + 0 + + -53 + + + 2 + to an object of type that is as close as possible to the original exception type, using + 1 + + 0 + + -31 + + + 2 + as a final fallback. All such types derive from boost:: + 1 + + 0 + + -16 + + + 2 + , and: ** if the original exception object derives from boost::(:link + 1 + + 0 + + -16 + + + 2 + :), then the boost::(:link + 1 + + 0 + + -16 + + + 2 + :) sub-object of the object referred to by the returned + 1 + + 0 + + -53 + + + 2 + is initialized by the boost::(:link + 1 + + 0 + + -16 + + + 2 + :) copy constructor; ** if available, the exception contains the std::type_info of the original exception object, accessible through + 1 + + 0 + + -56 + + + 2 + < + 1 + + 0 + + -8 + + + 2 + >. + + + + + 0 + + -18 + + + + 3 + 2 + (:auto !!!:) (:include synopsis:) !!!!Effects: Stores a copy of v in the + 1 + + 0 + + -67 + + + 2 + object. (:include throws:) + + + + + 0 + + -19 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -20 + + + + 3 + 2 + (:auto !!:) This header has been deprecated. Please #include < + 1 + + 0 + + -51 + + + 2 + > instead. + + + + + 0 + + -21 + + + + 1 + 2 + (:auto !!:) (:pagelist fmt="index" tags="function":) + + + + + 0 + + -22 + + + + 1 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: This function must not be called outside of a catch block. !!!!Returns: A pointer of type E to the current exception object, or null if the current exception object can not be converted to E *. !!!!Throws: Nothing. + + + + + 0 + + -23 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -24 + + + + 11 + 2 + (:auto !!:) Boost Exception supports transporting of exception objects between threads through cloning. This system is similar to (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:), but because Boost Exception can not rely on language support, the use of (:link + 1 + + 0 + + -28 + + + 2 + :) at the time of the throw is required in order to use cloning. !!!!Note: All exceptions emitted by the familiar function boost::(:link + 1 + + 0 + + -57 + + + 2 + :) are guaranteed to derive from boost::(:link + 1 + + 0 + + -16 + + + 2 + :) and to support cloning. (:include + 1 + + 0 + + -25 + + + 2 + :) (:include + 1 + + 0 + + -38 + + + 2 + :) + + + + + 0 + + -25 + + + + 15 + 2 + (:auto !!!:) Here is how cloning can be enabled in a throw-expression (15.1): [@#include <(:link + 1 + + 0 + + -71 + + + 2 + :)> #include <(:link + 1 + + 0 + + -63 + + + 2 + :)> #include <stdio.h> #include <errno.h> struct file_read_error: virtual boost::(:link + 1 + + 0 + + -16 + + + 2 + :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::(:link + 1 + + 0 + + -28 + + + 2 + :)(file_read_error()) << boost::(:link + 1 + + 0 + + -32 + + + 2 + :)(errno); }@] Of course, (:link + 1 + + 0 + + -28 + + + 2 + :) may be used with any exception type; there is no requirement that it should derive from boost::(:link + 1 + + 0 + + -16 + + + 2 + :). + + + + + 0 + + -26 + + + + 7 + 2 + (:auto !!!:) (:include synopsis:) This type is designed to be used as a standard (:link + 1 + + 0 + + -67 + + + 2 + :) instance for transporting the name of a relevant API function (which does not use exceptions to report errors) in exceptions deriving from boost::(:link + 1 + + 0 + + -16 + + + 2 + :). !!!Example: (:include + 1 + + 0 + + -77 + + + 2 + :) + + + + + 0 + + -27 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -28 + + + + 21 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: * T must be a class with an accessible no-throw copy constructor. * If T has any virtual base types, those types must have an accessible default constructor. !!!!Returns: An object of ''unspecified'' type which derives publicly from T. That is, the returned object can be intercepted by a catch(T &). !!!!Description: This function is designed to be used directly in a throw-expression to enable the (:link + 1 + + 0 + + -53 + + + 2 + :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link + 1 + + 0 + + -28 + + + 2 + :)(my_exception());@] Unless (:link + 1 + + 0 + + -28 + + + 2 + :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link + 1 + + 0 + + -17 + + + 2 + :) may return an (:link + 1 + + 0 + + -53 + + + 2 + :) which refers to an instance of (:link + 1 + + 0 + + -31 + + + 2 + :). See (:link + 1 + + 0 + + -17 + + + 2 + :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link + 1 + + 0 + + -57 + + + 2 + :). This is guaranteed to throw an exception that derives from boost::(:link + 1 + + 0 + + -16 + + + 2 + :) and supports the (:link + 1 + + 0 + + -53 + + + 2 + :) functionality. + + + + + 0 + + -29 + + + + 19 + 2 + (:auto !!!:) Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Let's say we have an exception type file_read_error, which takes a file name in its constructor. Consider the following function: [@void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error(????); }@] How can the file_read function pass a file name to the exception type constructor? All it has is a FILE handle. Using boost::(:link + 1 + + 0 + + -16 + + + 2 + :) allows us to free the file_read function from the burden of storing the file name in exceptions it throws: [@`#include <(:link + 1 + + 0 + + -51 + + + 2 + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <errno.h> struct file_read_error: virtual boost::(:link + 1 + + 0 + + -16 + + + 2 + :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw file_read_error() << boost::(:link + 1 + + 0 + + -32 + + + 2 + :)(errno); }@] If file_read detects a failure, it throws an exception which contains the information that is available at the time, namely the errno. Other relevant information, such as the file name, can be added in a context higher up the call stack, where it is known naturally: [@#include <(:link + 1 + + 0 + + -51 + + + 2 + :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> boost::shared_ptr<FILE> file_open( char const * file_name, char const * mode ); void file_read( FILE * f, void * buffer, size_t size ); void parse_file( char const * file_name ) { boost::shared_ptr<FILE> f = file_open(file_name,"rb"); assert(f); try { char buf[1024]; file_read( f.get(), buf, sizeof(buf) ); } catch( boost::(:link + 1 + + 0 + + -16 + + + 2 + :) & e ) { e << boost::(:link + 1 + + 0 + + -55 + + + 2 + :)(file_name); throw; } }@] The above function is (almost) exception-neutral -- if an exception is emitted by any function call within the try block, parse_file does not need to do any real work, but it intercepts any boost::(:link + 1 + + 0 + + -16 + + + 2 + :) object, stores the file name, and re-throws using a throw-expression with no operand (15.1.6). The rationale for catching any boost::(:link + 1 + + 0 + + -16 + + + 2 + :) object is that the file name is relevant to any failure that occurs in parse_file, ''even if the failure is unrelated to file I/O''. + + + + + 0 + + -30 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Definition: The expression + 1 + + 0 + + -67 + + + 2 + <Tag,T>::(:link + 1 + + 0 + + -30 + + + 2 + mod="m":) evaluates to T. + + + + + 0 + + -31 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) This type is used by the (:link + 1 + + 0 + + -53 + + + 2 + :) support in Boost Exception. Please see (:link + 1 + + 0 + + -17 + + + 2 + :). + + + + + 0 + + -32 + + + + 7 + 2 + (:auto !!!:) (:include synopsis:) This type is designed to be used as a standard (:link + 1 + + 0 + + -67 + + + 2 + :) instance for transporting a relevant errno value in exceptions deriving from boost::(:link + 1 + + 0 + + -16 + + + 2 + :). !!!Example: (:include + 1 + + 0 + + -77 + + + 2 + :) + + + + + 0 + + -33 + + + + 1 + 2 + (:auto !!!:) (:include synopsis:) !!!!Precondition: ep shall not be null. !!!!Throws: The exception to which ep refers. + + + + + 0 + + -34 + + + + 1 + 2 + (:auto !!:) (:pagelist fmt="index" tags="type":) + + + + + 0 + + -35 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -36 + + + + 7 + 2 + (:auto !!!:) (:include synopsis:) This type is designed to be used as a standard (:link + 1 + + 0 + + -67 + + + 2 + :) instance for transporting a relevant FILE pointer managed by a boost::shared_ptr<FILE> in exceptions deriving from boost::(:link + 1 + + 0 + + -16 + + + 2 + :). !!!Example: (:include + 1 + + 0 + + -77 + + + 2 + :) + + + + + 0 + + -37 @@ -5705,7 +8569,337 @@ 0 - -12 + -38 + + + + 37 + 2 + (:auto !!!:) When you catch an exception, you can call (:link + 1 + + 0 + + -17 + + + 2 + :) to get an (:link + 1 + + 0 + + -53 + + + 2 + :) object: [@#include <(:link + 1 + + 0 + + -9 + + + 2 + :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link + 1 + + 0 + + -16 + + + 2 + :)s void worker_thread( boost::(:link + 1 + + 0 + + -53 + + + 2 + :) & error ) { try { do_work(); error = boost::(:link + 1 + + 0 + + -53 + + + 2 + :)(); } catch( ... ) { error = boost::(:link + 1 + + 0 + + -17 + + + 2 + :)(); } }@] In the above example, note that (:link + 1 + + 0 + + -17 + + + 2 + :) captures the original type of the exception object. The exception can be thrown again using the (:link + 1 + + 0 + + -33 + + + 2 + :) function: [@// ...continued void work() { boost::(:link + 1 + + 0 + + -53 + + + 2 + :) error; boost::(:link http://www.boost.org/doc/html/boost/thread.html|thread:) t( boost::(:link http://www.boost.org/libs/bind/bind.html|bind:)(worker_thread,boost::(:link http://www.boost.org/doc/html/ref.html|ref:)(error)) ); t.(:link http://www.boost.org/doc/html/boost/thread.html|join:)(); if( error ) boost::(:link + 1 + + 0 + + -33 + + + 2 + :)(error); }@] Note that (:link + 1 + + 0 + + -17 + + + 2 + :) could fail to copy the original exception object in the following cases: * if there is not enough memory, in which case the returned (:link + 1 + + 0 + + -53 + + + 2 + :) points to an instance of std::bad_alloc, or * if (:link + 1 + + 0 + + -28 + + + 2 + :) was not used in the throw-expression passed to the original throw statement and the current implementation does not have the necessary compiler-specific support to copy the exception automatically, in which case the returned (:link + 1 + + 0 + + -53 + + + 2 + :) points to an instance of (:link + 1 + + 0 + + -31 + + + 2 + :). Regardless, the use of (:link + 1 + + 0 + + -17 + + + 2 + :) and (:link + 1 + + 0 + + -33 + + + 2 + :) in the above examples is well-formed. + + + + + 0 + + -39 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -40 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Description: Returns a const reference to the copy of the value passed to (:link + 1 + + 0 + + -67 + + + 2 + :)'s constructor stored in the (:link + 1 + + 0 + + -67 + + + 2 + :) object. !!!!Throws: Nothing. + + + + + 0 + + -41 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + 1 + + 0 + + -16 + + + 2 + :), or a type that derives (indirectly) from boost::(:link + 1 + + 0 + + -16 + + + 2 + :). !!!!Effects: Equivalent to x << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<0>() << ... << v.(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements|get:)<N>(). !!!!Returns: x. (:include throws:) + + + + + 0 + + -42 + + + + 7 + 2 + (:auto !!!:) (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link + 1 + + 0 + + -16 + + + 2 + :) object. * Copy constructor: initializes a boost::(:link + 1 + + 0 + + -16 + + + 2 + :) object which shares ownership with x of all data added through (:link + 1 + + 0 + + -43 + + + 2 + mod="/":), including data that is added at a future time. !!!!Throws: Nothing. + + + + + 0 + + -43 + + + + 7 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + 1 + + 0 + + -16 + + + 2 + :), or a type that derives (indirectly) from boost::(:link + 1 + + 0 + + -16 + + + 2 + :). !!!!Postcondition: A copy of v is stored into x. If x already contains data of type (:link + 1 + + 0 + + -67 + + + 2 + :)<Tag,T>, that data is overwritten. Basic exception safety guarantee. !!!!Returns: x. (:include throws:) + + + + + 0 + + -44 @@ -5716,7 +8910,7 @@ 0 - -21 + -24 2 @@ -5725,7 +8919,7 @@ 0 - -53 + -57 2 @@ -5734,7 +8928,7 @@ 0 - -15 + -45 2 @@ -5743,7 +8937,34 @@ 0 - -14 + -69 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -47 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -24 + + + 2 + mod="w":) ##(:link + 1 + + 0 + + -46 2 @@ -5761,34 +8982,7 @@ 0 - -21 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -16 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -59 - - - 2 - mod="w":) ##(:link - 1 - - 0 - - -49 + -74 2 @@ -5797,7 +8991,7 @@ 0 - -13 + -16 2 @@ -5806,7 +9000,7 @@ 0 - -32 + -49 2 @@ -5815,7 +9009,7 @@ 0 - -53 + -57 2 @@ -5824,7 +9018,7 @@ 0 - -44 + -67 2 @@ -5833,7 +9027,25 @@ 0 - -20 + -43 + + + 2 + :) ###(:link + 1 + + 0 + + -41 + + + 2 + :) ###(:link + 1 + + 0 + + -56 2 @@ -5846,12 +9058,39 @@ 2 + :) ##(:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:) Transporting of Exceptions between Threads ###(:link + 1 + + 0 + + -53 + + + 2 :) ###(:link 1 0 - -31 + -28 + + + 2 + :) ###(:link + 1 + + 0 + + -17 + + + 2 + :) ###(:link + 1 + + 0 + + -13 2 @@ -5864,57 +9103,12 @@ 2 - :) ##(:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:) Transporting of Exceptions between Threads ###(:link - 1 - - 0 - - -47 - - - 2 :) ###(:link 1 0 - -55 - - - 2 - :) ###(:link - 1 - - 0 - - -52 - - - 2 - :) ###(:link - 1 - - 0 - - -42 - - - 2 - :) ###(:link - 1 - - 0 - - -25 - - - 2 - :) ###(:link - 1 - - 0 - - -46 + -31 2 @@ -5923,7 +9117,7 @@ 0 - -50 + -61 2 @@ -5932,7 +9126,7 @@ 0 - -18 + -50 2 @@ -5941,7 +9135,7 @@ 0 - -61 + -22 2 @@ -5950,7 +9144,7 @@ 0 - -60 + -75 2 @@ -5959,7 +9153,7 @@ 0 - -39 + -76 2 @@ -5968,7 +9162,7 @@ 0 - -19 + -34 2 @@ -5977,7 +9171,7 @@ 0 - -29 + -21 2 @@ -5986,7 +9180,7 @@ 0 - -48 + -59 2 @@ -5995,7 +9189,7 @@ 0 - -51 + -68 2 @@ -6004,7 +9198,7 @@ 0 - -17 + -15 2 @@ -6013,7 +9207,7 @@ 0 - -8 + -14 2 @@ -6024,132 +9218,7 @@ 0 - -13 - - - - 13 - 2 - (:auto !!!:) (:include synopsis:) Class boost::(:link - 1 - - 0 - - -13 - - - 2 - :) is designed to be used as a universal base for user-defined exception types. An object of any type deriving from boost::(:link - 1 - - 0 - - -13 - - - 2 - :) can store data of arbitrary types, using the (:link - 1 - - 0 - - -44 - - - 2 - :) wrapper and (:link - 1 - - 0 - - -20 - - - 2 - mod="/":). To retrieve data from a boost::(:link - 1 - - 0 - - -13 - - - 2 - :) object, use the (:link - 1 - - 0 - - -31 - - - 2 - :) function template. - - - - - 0 - - -14 - - - - 11 - 2 - (:auto !!:) All exception types that derive from boost::(:link - 1 - - 0 - - -13 - - - 2 - :) can be used as type-safe containers of arbitrary data objects, while complying with the no-throw requirements (15.5.1) of the ANSI C++ standard for exception types. When exceptions derive from boost::(:link - 1 - - 0 - - -13 - - - 2 - :), arbitrary data can be added to exception objects: *At the point of the throw; *At a later time as exceptions bubble up the call stack. (:include - 1 - - 0 - - -26 - - - 2 - :) (:include - 1 - - 0 - - -7 - - - 2 - :) (:include - 1 - - 0 - - -56 - - - 2 - :) - - - - - 0 - - -15 + -45 @@ -6160,7 +9229,7 @@ 0 - -13 + -16 2 @@ -6169,7 +9238,7 @@ 0 - -13 + -16 2 @@ -6178,7 +9247,7 @@ 0 - -44 + -67 2 @@ -6187,7 +9256,7 @@ 0 - -20 + -43 2 @@ -6196,7 +9265,7 @@ 0 - -13 + -16 2 @@ -6205,7 +9274,7 @@ 0 - -44 + -67 2 @@ -6214,7 +9283,7 @@ 0 - -13 + -16 2 @@ -6223,7 +9292,7 @@ 0 - -20 + -43 2 @@ -6232,7 +9301,7 @@ 0 - -13 + -16 2 @@ -6241,7 +9310,7 @@ 0 - -20 + -43 2 @@ -6250,7 +9319,7 @@ 0 - -13 + -16 2 @@ -6259,7 +9328,7 @@ 0 - -31 + -56 2 @@ -6268,7 +9337,7 @@ 0 - -31 + -56 2 @@ -6277,7 +9346,7 @@ 0 - -50 + -61 2 @@ -6286,7 +9355,7 @@ 0 - -44 + -67 2 @@ -6295,7 +9364,7 @@ 0 - -13 + -16 2 @@ -6306,7 +9375,78 @@ 0 - -18 + -48 + + + + 5 + 2 + (:auto !!!:) (:include synopsis:) This type is designed to be used as a standard + 1 + + 0 + + -67 + + + 2 + instance for transporting strings returned by std::type_info::name in exceptions deriving from boost:: + 1 + + 0 + + -16 + + + 2 + objects. + + + + + 0 + + -49 + + + + 7 + 2 + (:auto !!!:) (:include synopsis:) This macro takes an exception object, records BOOST_CURRENT_FUNCTION, __FILE__ and __LINE__ in it, and forwards it to + 1 + + 0 + + -57 + + + 2 + . To recover this information at the catch site, use + 1 + + 0 + + -56 + + + 2 + ; the information is also included in the message returned by + 1 + + 0 + + -61 + + + 2 + . + + + + + 0 + + -50 @@ -6317,7 +9457,7 @@ 0 - -13 + -16 2 @@ -6326,7 +9466,7 @@ 0 - -50 + -61 2 @@ -6335,7 +9475,7 @@ 0 - -18 + -50 2 @@ -6344,7 +9484,7 @@ 0 - -18 + -50 2 @@ -6355,176 +9495,47 @@ 0 - -19 - - - - 1 - 2 - (:auto !!:) (:pagelist fmt="index" tags="type":) - - - - - 0 - - -20 + -46 7 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must be boost::(:link + (:auto !!!:) Deriving from boost::(:link 1 0 - -13 + -16 2 - :), or a type that derives (indirectly) from boost::(:link + :) effectively decouples the semantics of a failure from the information that is relevant to each individual instance of reporting a failure with a given semantic. In other words: with boost::(:link 1 0 - -13 + -16 2 - :). !!!!Postcondition: A copy of v is stored into x. If x already contains data of type (:link + :), what data a given exception object transports depends primarily on the context in which failures are reported (not on its type.) Since exception types need no members, it becomes very natural to throw exceptions that derive from more than one type to indicate multiple appropriate semantics: [@struct exception_base: virtual std::exception, virtual boost::(:link 1 0 - -44 + -16 2 - :)<Tag,T>, that data is overwritten. Basic exception safety guarantee. !!!!Returns: x. (:include throws:) + :) { }; struct io_error: virtual exception_base { }; struct file_error: virtual io_error { }; struct read_error: virtual io_error { }; struct file_read_error: virtual file_error, virtual read_error { };@] Using this approach, exception types become a simple tagging system for categorizing errors and selecting failures in exception handlers. 0 - -21 - - - - 11 - 2 - (:auto !!:) Boost Exception supports transporting of exception objects between threads through cloning. This system is similar to (:link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html|N2179:), but because Boost Exception can not rely on language support, the use of (:link - 1 - - 0 - - -55 - - - 2 - :) at the time of the throw is required in order to use cloning. !!!!Note: All exceptions emitted by the familiar function boost::(:link - 1 - - 0 - - -53 - - - 2 - :) are guaranteed to derive from boost::(:link - 1 - - 0 - - -13 - - - 2 - :) and to support cloning. (:include - 1 - - 0 - - -22 - - - 2 - :) (:include - 1 - - 0 - - -57 - - - 2 - :) - - - - - 0 - - -22 - - - - 11 - 2 - (:auto !!!:) Here is how cloning can be enabled in a throw-expression (15.1): [@#include <(:link - 1 - - 0 - - -27 - - - 2 - :)> #include <stdio.h> #include <errno.h> typedef boost::error_info<struct tag_errno,int> errno_info; class file_read_error: public boost::(:link - 1 - - 0 - - -13 - - - 2 - :) { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::(:link - 1 - - 0 - - -55 - - - 2 - :)(file_read_error()) << errno_info(errno); }@] Of course, (:link - 1 - - 0 - - -55 - - - 2 - :) may be used with any exception type; there is no requirement that it should derive from boost::(:link - 1 - - 0 - - -13 - - - 2 - :). - - - - - 0 - - -23 + -51 @@ -6537,140 +9548,7 @@ 0 - -24 - - - - 3 - 2 - !!!!Example: this is a possible output from the (:link - 1 - - 0 - - -50 - - - 2 - :) function, as used in ''libs/exception/example/example_io.cpp:'' [@example_io.cpp(83): 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<class fopen_error> std::exception::what: example_io error [struct tag_errno *] = 2, OS says "No such file or directory" [struct tag_file_name *] = tmp1.txt [struct tag_function *] = fopen [struct tag_open_mode *] = rb@] - - - - - 0 - - -25 - - - - 1 - 2 - (:auto !!!:) (:include synopsis:) !!!!Precondition: ep shall not be null. !!!!Throws: The exception to which ep refers. - - - - - 0 - - -26 - - - - 17 - 2 - (:auto !!!:) The following example demonstrates how errno can be stored in exception objects using Boost Exception: [@#include <(:link - 1 - - 0 - - -23 - - - 2 - :)> #include <errno.h> #include <iostream> typedef boost::(:link - 1 - - 0 - - -44 - - - 2 - :)<struct tag_errno,int> errno_info; //(1) class my_error: public boost::(:link - 1 - - 0 - - -13 - - - 2 - :), public std::exception { }; //(2) void f() { throw my_error() << errno_info(errno); //(3) } @] First, we instantiate the (:link - 1 - - 0 - - -44 - - - 2 - :) template using a unique identifier -- tag_errno, and the type of the info it identifies -- int. This provides compile-time type safety for the various values stored in exception objects. Second, we define class my_error, which derives from boost::(:link - 1 - - 0 - - -13 - - - 2 - :). Finally, (3) illustrates how the typedef from (1) can be used with (:link - 1 - - 0 - - -20 - - - 2 - |operator<<:) to store values in exception objects at the point of the throw. The stored errno value can be recovered at a later time like this: [@// ...continued void g() { try { f(); } catch( my_error & x ) { if( int const * err=boost::(:link - 1 - - 0 - - -31 - - - 2 - :)<errno_info>(x) ) std::cerr << "Error code: " << *err; } }@] The (:link - 1 - - 0 - - -31 - - - 2 - :) function template is instantiated with the typedef from (1), and is passed an exception object of a polymorphic type. If the exception object contains the requested value, err will point to it; otherwise a null pointer is returned. - - - - - 0 - - -27 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -28 + -52 @@ -6683,1005 +9561,7 @@ 0 - -29 - - - - 1 - 2 - (:auto !!:) (:pagelist fmt="index" tags="function":) - - - - - 0 - - -30 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) !!!!Description: Returns a const reference to the copy of the value passed to (:link - 1 - - 0 - - -44 - - - 2 - :)'s constructor stored in the (:link - 1 - - 0 - - -44 - - - 2 - :) object. !!!!Throws: Nothing. - - - - - 0 - - -31 - - - - 13 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link - 1 - - 0 - - -44 - - - 2 - :) template. * E must be polymorphic. !!!!Returns: * If dynamic_cast<boost::(:link - 1 - - 0 - - -13 - - - 2 - :) const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is null. * Otherwise, the returned pointer points to the stored value (use (:link - 1 - - 0 - - -20 - - - 2 - mod="/":) to store values in exception objects.) When x is destroyed, any pointers returned by (:link - 1 - - 0 - - -31 - - - 2 - :) become invalid. !!!!Throws: Nothing. !!!!Note: The interface of (:link - 1 - - 0 - - -31 - - - 2 - :) may be affected by the build (:link - 1 - - 0 - - -51 - - - 2 - :). - - - - - 0 - - -32 - - - - 7 - 2 - (:auto !!!:) (:include synopsis:) This macro takes an exception object, records BOOST_CURRENT_FUNCTION, __FILE__ and __LINE__ in it, and forwards it to - 1 - - 0 - - -53 - - - 2 - . To recover this information at the catch site, use - 1 - - 0 - - -31 - - - 2 - ; the information is also included in the message returned by - 1 - - 0 - - -50 - - - 2 - . - - - - - 0 - - -33 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: T must be a class with an accessible no-throw copy constructor as per (15.5.1). !!!!Returns: * If T derives from boost::(:link - 1 - - 0 - - -13 - - - 2 - :), the returned object is of type T and is a copy of x. * Otherwise, the returned object is of an unspecified type that derives publicly from both T and boost::(:link - 1 - - 0 - - -13 - - - 2 - :). The T sub-object is initialized from x by the T copy constructor. !!!!Throws: Nothing. - - - - - 0 - - -34 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -35 - - - - 7 - 2 - (:auto !!!:) (:include decl:) !!!!Effects: * Default constructor: initializes an empty boost::(:link - 1 - - 0 - - -13 - - - 2 - :) object. * Copy constructor: initializes a boost::(:link - 1 - - 0 - - -13 - - - 2 - :) object which shares ownership with x of all data added through (:link - 1 - - 0 - - -20 - - - 2 - mod="/":), including data that is added at a future time. !!!!Throws: Nothing. - - - - - 0 - - -36 - - - - 9 - 2 - (:auto !!!:) (:include synopsis:) This - 1 - - 0 - - -44 - - - 2 - typedef is used by - 1 - - 0 - - -52 - - - 2 - if it defaults to returning an - 1 - - 0 - - -47 - - - 2 - that refers to an object of type - 1 - - 0 - - -46 - - - 2 - , to record in it the std::type_info of the original exception object. - - - - - 0 - - -37 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -38 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -17 - - - - 71 - 2 - (:auto !!:) !!!Why doesn't boost::exception derive from std::exception? Despite that (:link - 1 - - 0 - - -59 - - - 2 - |virtual inheritance should be used in deriving from base exception types:), many programmers fail to follow this principle when deriving from std::exception. If boost::(:link - 1 - - 0 - - -13 - - - 2 - :) derives from std::exception, using the (:link - 1 - - 0 - - -33 - - - 2 - :) function with such user-defined types would introduce dangerous ambiguity which would break all catch(std::exception &) statements. Of course, boost::(:link - 1 - - 0 - - -13 - - - 2 - :) should not be used to replace std::exception as a base type in exception type hierarchies. Instead, it should be included as a virtual base, in addition to std::exception (which should also be derived virtually.) !!!Why is boost::exception abstract? To prevent exception-neutral contexts from erroneously erasing the type of the original exception when adding (:link - 1 - - 0 - - -44 - - - 2 - :) to an active exception object: [@catch( boost::(:link - 1 - - 0 - - -13 - - - 2 - :) & e ) { e (:link - 1 - - 0 - - -20 - - - 2 - |<<:) foo_info(foo); throw e; //Compile error: boost::(:link - 1 - - 0 - - -13 - - - 2 - :) is abstract }@] The correct code is: [@catch( boost::(:link - 1 - - 0 - - -13 - - - 2 - :) & e ) { e (:link - 1 - - 0 - - -20 - - - 2 - |<<:) foo_info(foo); throw; //Okay, re-throwing the original exception object. }@] !!!What is the space overhead of the boost::exception base class? The space overhead for the boost::exception data members is negligible in the context of exception handling. Throwing objects that derive from boost::(:link - 1 - - 0 - - -13 - - - 2 - :) does not by itself cause dynamic memory allocations. Deriving from boost::(:link - 1 - - 0 - - -13 - - - 2 - :) enables any data to be added to exceptions, which usually does allocate memory. However, this memory is reclaimed when the exception has been handled, and since typically user code does not allocate memory during the unrolling of the stack, adding error info to exceptions should not cause memory fragmentation. !!!Should I use boost::throw_exception or BOOST_THROW_EXCEPTION or just throw? The benefit of calling boost::(:link - 1 - - 0 - - -53 - - - 2 - :) instead of using throw directly is that it ensures that the emitted exception derives from boost::(:link - 1 - - 0 - - -13 - - - 2 - :) and that it is compatible with boost::(:link - 1 - - 0 - - -52 - - - 2 - :). The (:link - 1 - - 0 - - -32 - - - 2 - :) macro also results in a call to boost::(:link - 1 - - 0 - - -53 - - - 2 - :), but in addition it records in the exception object the __FILE__ and __LINE__ of the throw, as well as the pretty name of the function that throws. This has virtually no overhead, yet enables boost::(:link - 1 - - 0 - - -50 - - - 2 - :) to compose a more useful, if not user-friendly message. Typical use of boost::(:link - 1 - - 0 - - -50 - - - 2 - :) is: [@catch( boost::exception & e ) { std::cerr << "OMG!" << boost::diagnostic_information(e); } catch( ... ) { std::cerr << "OMG!!!"; }@] This is a possible message it may display, the first line is only possible if (:link - 1 - - 0 - - -32 - - - 2 - :) is used: [@example_io.cpp(83): Throw in function void parse_file(const char *) Dynamic exception type: class file_open_error std::exception::what: example_io error [struct tag_errno_code *] = 2, OS says "No such file or directory" [struct tag_file_name *] = tmp1.xml [struct tag_function *] = fopen [struct tag_open_mode *] = rb@] !!!Why is boost::exception integrated in boost::throw_exception? The boost::(:link - 1 - - 0 - - -53 - - - 2 - :) function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::(:link - 1 - - 0 - - -13 - - - 2 - :) as a base of any exception passed to boost::(:link - 1 - - 0 - - -53 - - - 2 - :). Such concerns are dictated by the typical strict interpretation of a common principle in C and C++, that users only pay for features they actually use. The problem is that users of Boost Exception can't by themselves cause a library to throw types that derive from boost::(:link - 1 - - 0 - - -13 - - - 2 - :), and without this they can't use any of the Boost Exception facilities. For example, if a user wants to use Boost Serialization in a separate thread, it is desirable to be able to transport exceptions emitted by that library into the main thread where they can be analyzed to generate a user-friendly message. This can be easily achieved using boost::(:link - 1 - - 0 - - -47 - - - 2 - :), but this requires that Boost Serialization throws exceptions using boost::(:link - 1 - - 0 - - -55 - - - 2 - :). If Boost Serialization calls boost::(:link - 1 - - 0 - - -53 - - - 2 - :) to throw, this behavior happens automatically and transparently. The cost of this integration is: * In terms of space: a pointer and 3 ints are added to the static size of exception objects. * In terms of speed: the pointer is initialized to null at the point of the throw. * In terms of coupling: about 400 self-contained lines of C++ with no external includes. !!!Why use operator<< overload for adding info to exceptions? Before throwing an object of type that derives from boost::(:link - 1 - - 0 - - -13 - - - 2 - :), it is often desirable to add one or more (:link - 1 - - 0 - - -44 - - - 2 - :) objects in it. The syntactic sugar provided by (:link - 1 - - 0 - - -20 - - - 2 - :) allows this to be done directly in a throw expression: [@throw error() (:link - 1 - - 0 - - -20 - - - 2 - |<<:) foo_info(foo) (:link - 1 - - 0 - - -20 - - - 2 - |<<:) bar_info(bar);@] which saves typing compared to this possible alternative: [@error e; e.add(foo_info(foo)); e.add(bar_info(bar)); throw e;@] and looks better than something like: [@throw error().add(foo_info(foo)).add(bar_info(bar));@] !!!Why is operator<< allowed to throw? This question is referring to the following issue. Consider this throw statement example: [@throw file_open_error() (:link - 1 - - 0 - - -20 - - - 2 - |<<:) file_name(fn);@] The intention here is to throw a file_open_error, however if (:link - 1 - - 0 - - -20 - - - 2 - mod="/":) fails to copy the std::string contained in the file_name - 1 - - 0 - - -44 - - - 2 - wrapper, a std::bad_alloc could propagate instead. This behavior seems undesirable to some programmers. Bjarne Stroustrup, The C++ Programming Language, 3rd Edition, page 371: ->''"Throwing an exception requires an object to throw. A C++ implementation is required to have enough spare memory to be able to throw bad_alloc in case of memory exhaustion. However, it is possible that throwing some other exception will cause memory exhaustion."'' So, an attempt to throw any exception may already result in propagating std::bad_alloc instead. - - - - - 0 - - -16 - - - - 7 - 2 - (:auto !!!:) Deriving from boost::(:link - 1 - - 0 - - -13 - - - 2 - :) effectively decouples the semantics of a failure from the information that is relevant to each individual instance of reporting a failure with a given semantic. In other words: with boost::(:link - 1 - - 0 - - -13 - - - 2 - :), what data a given exception object transports depends primarily on the context in which failures are reported (not on its type.) Since exception types need no members, it becomes very natural to throw exceptions that derive from more than one type to indicate multiple appropriate semantics: [@struct exception_base: virtual std::exception, virtual boost::(:link - 1 - - 0 - - -13 - - - 2 - :) { }; struct io_error: virtual exception_base { }; struct file_error: virtual io_error { }; struct read_error: virtual io_error { }; struct file_read_error: virtual file_error, virtual read_error { };@] Using this approach, exception types become a simple tagging system for categorizing errors and selecting failures in exception handlers. - - - - - 0 - - -39 - - - - 1 - 2 - (:auto !!:) (:pagelist tags="hpp":) - - - - - 0 - - -40 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -41 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -42 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) !!!!Effects: As if [@try { throw - 1 - - 0 - - -55 - - - 2 - (e); } catch(...) { return (:link - 1 - - 0 - - -52 - - - 2 - :)(); }@] - - - - - 0 - - -43 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) !!!!Definition: The expression - 1 - - 0 - - -44 - - - 2 - <Tag,T>::(:link - 1 - - 0 - - -43 - - - 2 - mod="m":) evaluates to T. - - - - - 0 - - -44 - - - - 37 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: T must have accessible copy constructor and must not be a reference (there is no requirement that T's copy constructor does not throw.) !!!!Description: This class template is used to associate a Tag type with a value type T. Objects of type (:link - 1 - - 0 - - -44 - - - 2 - :)<Tag,T> can be passed to (:link - 1 - - 0 - - -20 - - - 2 - mod="/":) to be stored in objects of type boost::(:link - 1 - - 0 - - -13 - - - 2 - :). !!!!Usage: The header <(:link - 1 - - 0 - - -38 - - - 2 - :)> provides a declaration of the (:link - 1 - - 0 - - -44 - - - 2 - :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, for example: [@#include <(:link - 1 - - 0 - - -38 - - - 2 - :)> struct tag_errno; typedef boost::(:link - 1 - - 0 - - -44 - - - 2 - :)<tag_errno,int> errno_info;@] Or, the shorter equivalent: [@#include <(:link - 1 - - 0 - - -38 - - - 2 - :)> typedef boost::(:link - 1 - - 0 - - -44 - - - 2 - :)<struct tag_errno,int> errno_info;@] This errno_info typedef can be passed to (:link - 1 - - 0 - - -20 - - - 2 - mod="/":) (#include <(:link - 1 - - 0 - - -27 - - - 2 - :)> first) to store an int named tag_errno in exceptions of types that derive from boost::(:link - 1 - - 0 - - -13 - - - 2 - :): [@throw file_read_error() (:link - 1 - - 0 - - -20 - - - 2 - |<<:) errno_info(errno);@] It can also be passed to (:link - 1 - - 0 - - -31 - - - 2 - :) (#include <(:link - 1 - - 0 - - -37 - - - 2 - :)> first) to retrieve the tag_errno int from a boost::(:link - 1 - - 0 - - -13 - - - 2 - :): [@catch( boost::(:link - 1 - - 0 - - -13 - - - 2 - :) & x ) { if( int const * e=boost::(:link - 1 - - 0 - - -31 - - - 2 - :)<errno_info>(x) ) .... }@] - - - - - 0 - - -45 - - - - 1 - 2 - (:auto !!:) !!!Synopsis (:include synopsis:) - - - - - 0 - - -46 - - - - 5 - 2 - (:auto !!!:) (:include synopsis:) This type is used by the (:link - 1 - - 0 - - -47 - - - 2 - :) support in Boost Exception. Please see (:link - 1 - - 0 - - -52 - - - 2 - :). - - - - - 0 - - -47 + -53 @@ -7692,7 +9572,7 @@ 0 - -47 + -53 2 @@ -7701,7 +9581,7 @@ 0 - -47 + -53 2 @@ -7710,7 +9590,7 @@ 0 - -47 + -53 2 @@ -7719,7 +9599,7 @@ 0 - -47 + -53 2 @@ -7728,7 +9608,7 @@ 0 - -47 + -53 2 @@ -7737,7 +9617,7 @@ 0 - -47 + -53 2 @@ -7746,7 +9626,7 @@ 0 - -47 + -53 2 @@ -7755,7 +9635,7 @@ 0 - -52 + -17 2 @@ -7764,7 +9644,7 @@ 0 - -25 + -33 2 @@ -7773,7 +9653,7 @@ 0 - -47 + -53 2 @@ -7782,7 +9662,7 @@ 0 - -44 + -67 2 @@ -7791,7 +9671,7 @@ 0 - -13 + -16 2 @@ -7802,618 +9682,130 @@ 0 - -48 + -47 - 1 + 27 2 - (:auto !!:) (:pagelist tags="macro":) - - - - - 0 - - -49 - - - - 19 - 2 - (:auto !!:) Boost Exception provides a namespace-scope function (:link + (:auto !!:) Some exception hierarchies can not be modified to make boost::(:link 1 0 - -50 + -16 2 - :) which takes a boost::(:link + :) a base type. In this case, the (:link 1 0 - -13 + -6 2 - :). The returned string contains: *the string representation of all data objects added to the boost::(:link + :) function template can be used to make exception objects derive from boost::(:link 1 0 - -13 + -16 2 - :) through (:link + :) anyway. Here is an example: [@#include <(:link 1 0 - -20 + -51 2 - mod="/":); *the output from std::exception::what; *additional platform-specific diagnostic information. The returned string is not presentable as a friendly user message, but because it is generated automatically, it is useful for debugging or logging purposes. Here is an example: [@#include <(:link + :)> #include <stdexcept> typedef boost::(:link 1 0 - -23 + -67 2 - :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link + :)<struct tag_std_range_min,size_t> std_range_min; typedef boost::(:link 1 0 - -13 + -67 2 - :). void g() { try { f(); } catch( boost::(:link + :)<struct tag_std_range_max,size_t> std_range_max; typedef boost::(:link 1 0 - -13 + -67 2 - :) & e ) { std::cerr << (:link + :)<struct tag_std_range_index,size_t> std_range_index; template <class T> class my_container { public: size_t size() const; T const & operator[]( size_t i ) const { if( i > size() ) throw boost::(:link 1 0 - -50 + -6 2 - :)(e); } }@] (:include + :)(std::range_error("Index out of range")) << std_range_min(0) << std_range_max(size()) << std_range_index(i); //.... } }; @] The call to (:link 1 0 - -24 + -6 2 - :) - - - - - 0 - - -50 - - - - 37 - 2 - (:auto !!!:) (:include synopsis:) !!!!Returns: A string value that contains varying amount of implementation-specific diagnostic information about the passed object: *If E can be statically converted to boost::(:link + :)<T> gets us an object of ''unspecified type'' which is guaranteed to derive from both boost::(:link 1 0 - -13 + -16 2 - :), the returned value contains the string representations of all (:link + :) and T. This makes it possible to use (:link 1 0 - -44 + -43 2 - :) objects stored in the boost::(:link + mod="/":) to store additional information in the exception object. The exception can be intercepted as T &, so existing exception handling will not break. It can also be intercepted as boost::(:link 1 0 - -13 + -16 2 - :) through (:link + :) &, so that (:link 1 0 - -20 + -69 2 - mod="/":), along with other diagnostic information relevant to the exception. If e can be dynamically converted to std::exception, the returned value also contains the what() string. *Otherwise, if E can be statically converted std::exception: **if e can be dynamically converted to boost::exception, the returned value is the same as if E could be statically converted to boost::(:link - 1 - - 0 - - -13 - - - 2 - :); **otherwise the returned value contains the what() string. *Otherwise, the boost::(:link - 1 - - 0 - - -50 - - - 2 - :) template is not available. The string representation of each (:link - 1 - - 0 - - -44 - - - 2 - :) object is deduced by a function call that is bound at the time the (:link - 1 - - 0 - - -44 - - - 2 - :)<Tag,T> template is instantiated. The following overload resolutions are attempted in order: #Unqualified call to to_string(x), where x is of type (:link - 1 - - 0 - - -44 - - - 2 - :)<Tag,T> (the return value is expected to be of type std::string.) #Unqualified call to to_string(x.(:link - 1 - - 0 - - -30 - - - 2 - mod="m":)()) (the return value is expected to be of type std::string.) #Unqualified call to s << x.(:link - 1 - - 0 - - -30 - - - 2 - mod="m":)(), where s is a std::ostringstream. The first successfully bound function is used at the time (:link - 1 - - 0 - - -50 - - - 2 - :) is called; if all 3 overload resolutions are unsuccessful, the system is unable to convert the (:link - 1 - - 0 - - -44 - - - 2 - :) object to string, and ''an unspecified stub string value is used without issuing a compile error.'' The - 1 - - 0 - - -47 - - - 2 - overload of - 1 - - 0 - - -50 - - - 2 - is equivalent to: [@if( p ) try { - 1 - - 0 - - -25 - - - 2 - (p); } catch(...) { return - 1 - - 0 - - -18 - - - 2 - (); } else return <unspecified-string-value>;@] !!!!Notes: *The format of the returned string is unspecified. *The returned string is ''not'' user-friendly. *The returned string may include additional platform-specific diagnostic information. (:include - 1 - - 0 - - -24 - - - 2 - :) - - - - - 0 - - -51 - - - - 19 - 2 - (:auto !!:) Boost Exception responds to the following configuration macros: '''BOOST_NO_RTTI'''\\ '''BOOST_NO_TYPEID''' 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 (:link - 1 - - 0 - - -31 - - - 2 - :) function template can be called with any exception type. If BOOST_NO_RTTI is defined, (:link - 1 - - 0 - - -31 - - - 2 - :) can be used only with objects of type boost::(:link - 1 - - 0 - - -13 - - - 2 - :). !!!!Note: 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. '''BOOST_EXCEPTION_DISABLE''' By default, (:link - 1 - - 0 - - -55 - - - 2 - :) and (:link - 1 - - 0 - - -33 - - - 2 - :) are integrated directly in the (:link - 1 - - 0 - - -53 - - - 2 - :) function. Defining BOOST_EXCEPTION_DISABLE disables this integration. 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 (:link - 1 - - 0 - - -41 - - - 2 - :). '''BOOST_NO_EXCEPTIONS''' This macro disables exception handling in Boost, forwarding all exceptions to a user-defined non-template version of boost:: - 1 - - 0 - - -53 - - - 2 - . 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:: - 1 - - 0 - - -50 - - - 2 - (of course under BOOST_NO_EXCEPTIONS, the user-defined boost::throw_exception is not allowed to return to the caller.) - - - - - 0 - - -52 - - - - 33 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: The (:link - 1 - - 0 - - -52 - - - 2 - :) function must not be called outside of a catch block. !!!!Returns: * An (:link - 1 - - 0 - - -47 - - - 2 - :) that refers to the currently handled exception or a copy of the currently handled exception. * If the function needs to allocate memory and the attempt fails, it returns an (:link - 1 - - 0 - - -47 - - - 2 - :) that refers to an instance of std::bad_alloc. !!!!Throws: Nothing. !!!!Notes: * It is unspecified whether the return values of two successive calls to (:link - 1 - - 0 - - -52 - - - 2 - :) refer to the same exception object. * Correct implementation of (:link - 1 - - 0 - - -52 - - - 2 - :) may require compiler support, unless (:link - 1 - - 0 - - -55 - - - 2 - :) was used at the time the currently handled exception object was passed to throw. Whenever - 1 - - 0 - - -52 - - - 2 - fails to properly copy the current exception object, it returns an - 1 - - 0 - - -47 - - - 2 - to an object of type that is as close as possible to the original exception type, using - 1 - - 0 - - -46 - - - 2 - as a final fallback. All such types derive from boost:: - 1 - - 0 - - -13 - - - 2 - , and: ** if the original exception object derives from boost::(:link - 1 - - 0 - - -13 - - - 2 - :), then the boost::(:link - 1 - - 0 - - -13 - - - 2 - :) sub-object of the object referred to by the returned - 1 - - 0 - - -47 - - - 2 - is initialized by the boost::(:link - 1 - - 0 - - -13 - - - 2 - :) copy constructor; ** if available, the exception contains the std::type_info of the original exception object, accessible through - 1 - - 0 - - -31 - - - 2 - < - 1 - - 0 - - -36 - - - 2 - >. - - - - - 0 - - -53 - - - - 17 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: E must derive publicly from std::exception. !!!!Effects: * If BOOST_NO_EXCEPTIONS is not defined, boost::(:link - 1 - - 0 - - -53 - - - 2 - :)(e) is equivalent to throw boost::(:link - 1 - - 0 - - -55 - - - 2 - :)(boost::(:link - 1 - - 0 - - -33 - - - 2 - :)(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::(:link - 1 - - 0 - - -53 - - - 2 - :)(e) is equivalent to throw e; * If BOOST_NO_EXCEPTIONS is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of (:link - 1 - - 0 - - -53 - - - 2 - :) are allowed to assume that the function never returns; therefore, if the user-defined (:link - 1 - - 0 - - -53 - - - 2 - :) returns, the behavior is undefined. !!!!Note: Under BOOST_NO_EXCEPTIONS, unless BOOST_EXCEPTION_DISABLE is also defined, users can examine the passed exception object using boost:: - 1 - - 0 - - -31 - - - 2 - , or format an automatic diagnostic message using boost:: - 1 - - 0 - - -50 - - - 2 - . + |more information can be added to the exception at a later time:). @@ -8424,18 +9816,9 @@ - 3 + 1 2 - (:auto !!!:) (:include decl:) !!!!Effects: Frees all resources associated with a boost::(:link - 1 - - 0 - - -13 - - - 2 - :) object. !!!!Throws: Nothing. + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -8446,99 +9829,36 @@ - 21 + 7 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: * T must be a class with an accessible no-throw copy constructor. * If T has any virtual base types, those types must have an accessible default constructor. !!!!Returns: An object of ''unspecified'' type which derives publicly from T. That is, the returned object can be intercepted by a catch(T &). !!!!Description: This function is designed to be used directly in a throw-expression to enable the (:link + (:auto !!!:) (:include synopsis:) This type is designed to be used as a standard (:link 1 0 - -47 + -67 2 - :) support in Boost Exception. For example: [@class my_exception: public std::exception { }; .... throw boost::(:link + :) instance for transporting a relevant file name in exceptions deriving from boost::(:link 1 0 - -55 + -16 2 - :)(my_exception());@] Unless (:link + :). !!!Example: (:include 1 0 - -55 + -77 2 - :) is called at the time an exception object is used in a throw-expression, an attempt to copy it using (:link - 1 - - 0 - - -52 - - - 2 - :) may return an (:link - 1 - - 0 - - -47 - - - 2 - :) which refers to an instance of (:link - 1 - - 0 - - -46 - - - 2 - :). See (:link - 1 - - 0 - - -52 - - - 2 - :) for details. !!!!Note: Instead of using the throw keyword directly, it is preferable to call boost::(:link - 1 - - 0 - - -53 - - - 2 - :). This is guaranteed to throw an exception that derives from boost::(:link - 1 - - 0 - - -13 - - - 2 - :) and supports the (:link - 1 - - 0 - - -47 - - - 2 - :) functionality. + :) @@ -8551,57 +9871,57 @@ 13 2 - (:auto !!!:) The code snippet below demonstrates how boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) can be used to bundle the name of the function that failed, together with the reported errno so that they can be added to exception objects more conveniently together: [@#include <(:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: * ErrorInfo must be an instance of the (:link 1 0 - -40 + -67 2 - :)> #include <boost/shared_ptr.hpp> #include <stdio.h> #include <string> #include <errno.h> typedef boost::(:link + :) template. * E must be polymorphic. !!!!Returns: * If dynamic_cast<boost::(:link 1 0 - -44 + -16 2 - :)<struct tag_file_name,std::string> file_name_info; typedef boost::(:link + :) const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is null. * Otherwise, the returned pointer points to the stored value (use (:link 1 0 - -44 + -43 2 - :)<struct tag_function,char const *> function_info; typedef boost::(:link + mod="/":) to store values in exception objects.) When x is destroyed, any pointers returned by (:link 1 0 - -44 + -56 2 - :)<struct tag_errno,int> errno_info; typedef boost::tuple<function_info,errno_info> clib_failure; class file_open_error: public boost::(:link + :) become invalid. !!!!Throws: Nothing. !!!!Note: The interface of (:link 1 0 - -13 + -56 2 - :) { }; boost::shared_ptr<FILE> file_open( char const * name, char const * mode ) { if( FILE * f=fopen(name,mode) ) return boost::shared_ptr<FILE>(f,fclose); else throw file_open_error() << file_name_info(name) << clib_failure("fopen",errno); }@] Note that the members of a boost::(:link http://www.boost.org/libs/tuple/doc/tuple_users_guide.html|tuple:) are stored separately in exception objects; they can only be retrieved individually, using (:link + :) may be affected by the build (:link 1 0 - -31 + -68 2 @@ -8616,171 +9936,81 @@ - 37 + 17 2 - (:auto !!!:) When you catch an exception, you can call (:link + (:auto !!!:) (:include synopsis:) !!!!Requirements: E must derive publicly from std::exception. !!!!Effects: * If BOOST_NO_EXCEPTIONS is not defined, boost::(:link 1 0 - -52 + -57 2 - :) to get an (:link + :)(e) is equivalent to throw boost::(:link 1 0 - -47 + -28 2 - :) object: [@#include <(:link + :)(boost::(:link 1 0 - -10 + -6 2 - :)> #include <boost/thread.hpp> #include <boost/bind.hpp> void do_work(); //throws cloning-enabled boost::(:link + :)(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::(:link 1 0 - -13 + -57 2 - :)s void worker_thread( boost::(:link + :)(e) is equivalent to throw e; * If BOOST_NO_EXCEPTIONS is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of (:link 1 0 - -47 + -57 2 - :) & error ) { try { do_work(); error = boost::(:link + :) are allowed to assume that the function never returns; therefore, if the user-defined (:link 1 0 - -47 + -57 2 - :)(); } catch( ... ) { error = boost::(:link + :) returns, the behavior is undefined. !!!!Note: Under BOOST_NO_EXCEPTIONS, unless BOOST_EXCEPTION_DISABLE is also defined, users can examine the passed exception object using boost:: 1 0 - -52 + -56 2 - :)(); } }@] In the above example, note that (:link + , or format an automatic diagnostic message using boost:: 1 0 - -52 + -61 2 - :) captures the original type of the exception object. The exception can be thrown again using the (:link - 1 - - 0 - - -25 - - - 2 - :) function: [@// ...continued void work() { boost::(:link - 1 - - 0 - - -47 - - - 2 - :) error; boost::(:link http://www.boost.org/doc/html/boost/thread.html|thread:) t( boost::(:link http://www.boost.org/libs/bind/bind.html|bind:)(worker_thread,boost::(:link http://www.boost.org/doc/html/ref.html|ref:)(error)) ); t.(:link http://www.boost.org/doc/html/boost/thread.html|join:)(); if( error ) boost::(:link - 1 - - 0 - - -25 - - - 2 - :)(error); }@] Note that (:link - 1 - - 0 - - -52 - - - 2 - :) could fail to copy the original exception object in the following cases: * if there is not enough memory, in which case the returned (:link - 1 - - 0 - - -47 - - - 2 - :) points to an instance of std::bad_alloc, or * if (:link - 1 - - 0 - - -55 - - - 2 - :) was not used in the throw-expression passed to the original throw statement and the current implementation does not have the necessary compiler-specific support to copy the exception automatically, in which case the returned (:link - 1 - - 0 - - -47 - - - 2 - :) points to an instance of (:link - 1 - - 0 - - -46 - - - 2 - :). Regardless, the use of (:link - 1 - - 0 - - -52 - - - 2 - :) and (:link - 1 - - 0 - - -25 - - - 2 - :) in the above examples is well-formed. + . @@ -8791,18 +10021,9 @@ - 3 + 1 2 - (:auto !!!:) (:include synopsis:) !!!!Effects: Stores a copy of v in the - 1 - - 0 - - -44 - - - 2 - object. (:include throws:) + (:auto !!:) !!!Synopsis (:include synopsis:) @@ -8813,27 +10034,9 @@ - 5 + 1 2 - (:auto !!!:) Exception types should use virtual inheritance when deriving from other exception types. This insight is due to Andrew Koenig. Using virtual inheritance prevents ambiguity problems in the exception handler: [@#include <iostream> struct my_exc1 : std::exception { char const* what() const throw(); }; struct my_exc2 : std::exception { char const* what() const throw(); }; struct your_exc3 : my_exc1, my_exc2 {}; int main() { try { throw your_exc3(); } catch(std::exception const& e) {} catch(...) { std::cout << "whoops!" << std::endl; } }@] The program above outputs "whoops!" because the conversion to std::exception is ambiguous. The overhead introduced by virtual inheritance is always negligible in the context of exception handling. Note that virtual bases are initialized directly by the constructor of the most-derived-type (the type passed to the throw statement, in case of exceptions.) However, typically this detail is of no concern when boost::(:link - 1 - - 0 - - -13 - - - 2 - :) is used, because it enables exception types to be trivial structs with no members (there's nothing to initialize.) See (:link - 1 - - 0 - - -16 - - - 2 - mod="w":). + (:auto !!:) (:pagelist tags="macro":) @@ -8844,14 +10047,884 @@ - 45 + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -61 + + + + 37 + 2 + (:auto !!!:) (:include synopsis:) !!!!Returns: A string value that contains varying amount of implementation-specific diagnostic information about the passed object: *If E can be statically converted to boost::(:link + 1 + + 0 + + -16 + + + 2 + :), the returned value contains the string representations of all (:link + 1 + + 0 + + -67 + + + 2 + :) objects stored in the boost::(:link + 1 + + 0 + + -16 + + + 2 + :) through (:link + 1 + + 0 + + -43 + + + 2 + mod="/":), along with other diagnostic information relevant to the exception. If e can be dynamically converted to std::exception, the returned value also contains the what() string. *Otherwise, if E can be statically converted std::exception: **if e can be dynamically converted to boost::exception, the returned value is the same as if E could be statically converted to boost::(:link + 1 + + 0 + + -16 + + + 2 + :); **otherwise the returned value contains the what() string. *Otherwise, the boost::(:link + 1 + + 0 + + -61 + + + 2 + :) template is not available. The string representation of each (:link + 1 + + 0 + + -67 + + + 2 + :) object is deduced by a function call that is bound at the time the (:link + 1 + + 0 + + -67 + + + 2 + :)<Tag,T> template is instantiated. The following overload resolutions are attempted in order: #Unqualified call to to_string(x), where x is of type (:link + 1 + + 0 + + -67 + + + 2 + :)<Tag,T> (the return value is expected to be of type std::string.) #Unqualified call to to_string(x.(:link + 1 + + 0 + + -40 + + + 2 + mod="m":)()) (the return value is expected to be of type std::string.) #Unqualified call to s << x.(:link + 1 + + 0 + + -40 + + + 2 + mod="m":)(), where s is a std::ostringstream. The first successfully bound function is used at the time (:link + 1 + + 0 + + -61 + + + 2 + :) is called; if all 3 overload resolutions are unsuccessful, the system is unable to convert the (:link + 1 + + 0 + + -67 + + + 2 + :) object to string, and ''an unspecified stub string value is used without issuing a compile error.'' The + 1 + + 0 + + -53 + + + 2 + overload of + 1 + + 0 + + -61 + + + 2 + is equivalent to: [@if( p ) try { + 1 + + 0 + + -33 + + + 2 + (p); } catch(...) { return + 1 + + 0 + + -50 + + + 2 + (); } else return <unspecified-string-value>;@] !!!!Notes: *The format of the returned string is unspecified. *The returned string is ''not'' user-friendly. *The returned string may include additional platform-specific diagnostic information. (:include + 1 + + 0 + + -7 + + + 2 + :) + + + + + 0 + + -62 + + + + 17 + 2 + (:auto !!!:) The following example demonstrates how errno can be stored in exception objects using Boost Exception: [@#include <(:link + 1 + + 0 + + -51 + + + 2 + :)> #include <iostream> typedef boost::(:link + 1 + + 0 + + -67 + + + 2 + :)<struct tag_my_info,int> my_info; //(1) struct my_error: virtual boost::(:link + 1 + + 0 + + -16 + + + 2 + :), virtual std::exception { }; //(2) void f() { throw my_error() << my_info(42); //(3) }@] First, we instantiate the (:link + 1 + + 0 + + -67 + + + 2 + :) template using a unique identifier -- tag_my_info, and the type of the info it identifies -- int. This provides compile-time type safety for the various values stored in exception objects. Second, we define class my_error, which derives from boost::(:link + 1 + + 0 + + -16 + + + 2 + :). Finally, (3) illustrates how the typedef from (1) can be used with (:link + 1 + + 0 + + -43 + + + 2 + |operator<<:) to store values in exception objects at the point of the throw. The stored my_info value can be recovered at a later time like this: [@// ...continued void g() { try { f(); } catch( my_error & x ) { if( int const * mi=boost::(:link + 1 + + 0 + + -56 + + + 2 + :)<my_info>(x) ) std::cerr << "My info: " << *mi; } }@] The (:link + 1 + + 0 + + -56 + + + 2 + :) function template is instantiated with the typedef from (1), and is passed an exception object of a polymorphic type. If the exception object contains the requested value, err will point to it; otherwise a null pointer is returned. + + + + + 0 + + -63 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -64 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -65 + + + + 7 + 2 + (:auto !!!:) (:include synopsis:) This type is designed to be used as a standard (:link + 1 + + 0 + + -67 + + + 2 + :) instance for transporting a relevant text file line number, for example in parse error exceptions deriving from boost::(:link + 1 + + 0 + + -16 + + + 2 + :). !!!Example: (:include + 1 + + 0 + + -77 + + + 2 + :) + + + + + 0 + + -66 + + + + 7 + 2 + (:auto !!!:) (:include synopsis:) This type is designed to be used as a standard (:link + 1 + + 0 + + -67 + + + 2 + :) instance for transporting the string passed as a second argument to fopen in exceptions indicating fopen failures and deriving from boost::(:link + 1 + + 0 + + -16 + + + 2 + :). !!!Example: (:include + 1 + + 0 + + -77 + + + 2 + :) + + + + + 0 + + -67 + + + + 41 + 2 + (:auto !!!:) (:include synopsis:) !!!!Requirements: T must have accessible copy constructor and must not be a reference (there is no requirement that T's copy constructor does not throw.) !!!!Description: This class template is used to associate a Tag type with a value type T. Objects of type (:link + 1 + + 0 + + -67 + + + 2 + :)<Tag,T> can be passed to (:link + 1 + + 0 + + -43 + + + 2 + mod="/":) to be stored in objects of type boost::(:link + 1 + + 0 + + -16 + + + 2 + :). !!!!Usage: The header <(:link + 1 + + 0 + + -60 + + + 2 + :)> provides a declaration of the (:link + 1 + + 0 + + -67 + + + 2 + :) template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, for example: [@#include <(:link + 1 + + 0 + + -60 + + + 2 + :)> struct tag_errno; typedef boost::(:link + 1 + + 0 + + -67 + + + 2 + :)<tag_errno,int> errno_info;@] Or, the shorter equivalent: [@#include <(:link + 1 + + 0 + + -60 + + + 2 + :)> typedef boost::(:link + 1 + + 0 + + -67 + + + 2 + :)<struct tag_errno,int> errno_info;@] This errno_info typedef can be passed to (:link + 1 + + 0 + + -43 + + + 2 + mod="/":) (#include <(:link + 1 + + 0 + + -71 + + + 2 + :)> first) to store an int named tag_errno in exceptions of types that derive from boost::(:link + 1 + + 0 + + -16 + + + 2 + :): [@throw file_read_error() (:link + 1 + + 0 + + -43 + + + 2 + |<<:) errno_info(errno);@] It can also be passed to (:link + 1 + + 0 + + -56 + + + 2 + :) (#include <(:link + 1 + + 0 + + -27 + + + 2 + :)> first) to retrieve the tag_errno int from a boost::(:link + 1 + + 0 + + -16 + + + 2 + :): [@catch( boost::(:link + 1 + + 0 + + -16 + + + 2 + :) & x ) { if( int const * e=boost::(:link + 1 + + 0 + + -56 + + + 2 + :)<errno_info>(x) ) .... }@] For convenience and uniformity, Boost Exception defines the following commonly used (:link + 1 + + 0 + + -67 + + + 2 + :) typedefs, ready for use with (:link + 1 + + 0 + + -43 + + + 2 + mod="/":): (:pagelist tags="error_info_instance":) + + + + + 0 + + -68 + + + + 19 + 2 + (:auto !!:) Boost Exception responds to the following configuration macros: '''BOOST_NO_RTTI'''\\ '''BOOST_NO_TYPEID''' 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 (:link + 1 + + 0 + + -56 + + + 2 + :) function template can be called with any exception type. If BOOST_NO_RTTI is defined, (:link + 1 + + 0 + + -56 + + + 2 + :) can be used only with objects of type boost::(:link + 1 + + 0 + + -16 + + + 2 + :). !!!!Note: 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. '''BOOST_EXCEPTION_DISABLE''' By default, (:link + 1 + + 0 + + -28 + + + 2 + :) and (:link + 1 + + 0 + + -6 + + + 2 + :) are integrated directly in the (:link + 1 + + 0 + + -57 + + + 2 + :) function. Defining BOOST_EXCEPTION_DISABLE disables this integration. 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 (:link + 1 + + 0 + + -54 + + + 2 + :). '''BOOST_NO_EXCEPTIONS''' This macro disables exception handling in Boost, forwarding all exceptions to a user-defined non-template version of boost:: + 1 + + 0 + + -57 + + + 2 + . 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:: + 1 + + 0 + + -61 + + + 2 + (of course under BOOST_NO_EXCEPTIONS, the user-defined boost::throw_exception is not allowed to return to the caller.) + + + + + 0 + + -69 + + + + 11 + 2 + (:auto !!:) All exception types that derive from boost::(:link + 1 + + 0 + + -16 + + + 2 + :) can be used as type-safe containers of arbitrary data objects, while complying with the no-throw requirements (15.5.1) of the ANSI C++ standard for exception types. When exceptions derive from boost::(:link + 1 + + 0 + + -16 + + + 2 + :), arbitrary data can be added to exception objects: *At the point of the throw; *At a later time as exceptions bubble up the call stack. (:include + 1 + + 0 + + -62 + + + 2 + :) (:include + 1 + + 0 + + -29 + + + 2 + :) (:include + 1 + + 0 + + -10 + + + 2 + :) + + + + + 0 + + -70 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -71 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -72 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -73 + + + + 1 + 2 + (:auto !!:) !!!Synopsis (:include synopsis:) + + + + + 0 + + -74 + + + + 19 + 2 + (:auto !!:) Boost Exception provides a namespace-scope function (:link + 1 + + 0 + + -61 + + + 2 + :) which takes a boost::(:link + 1 + + 0 + + -16 + + + 2 + :). The returned string contains: *the string representation of all data objects added to the boost::(:link + 1 + + 0 + + -16 + + + 2 + :) through (:link + 1 + + 0 + + -43 + + + 2 + mod="/":); *the output from std::exception::what; *additional platform-specific diagnostic information. The returned string is not presentable as a friendly user message, but because it is generated automatically, it is useful for debugging or logging purposes. Here is an example: [@#include <(:link + 1 + + 0 + + -51 + + + 2 + :)> #include <iostream> void f(); //throws unknown types that derive from boost::(:link + 1 + + 0 + + -16 + + + 2 + :). void g() { try { f(); } catch( boost::(:link + 1 + + 0 + + -16 + + + 2 + :) & e ) { std::cerr << (:link + 1 + + 0 + + -61 + + + 2 + :)(e); } }@] (:include + 1 + + 0 + + -7 + + + 2 + :) + + + + + 0 + + -75 + + + + 73 2 !!Synopsis List of documented definitions, declarations and includes by header file: `#include <(:link 1 0 - -34 + -64 2 @@ -8860,7 +10933,7 @@ 0 - -34 + -64 2 @@ -8869,7 +10942,7 @@ 0 - -38 + -60 2 @@ -8878,7 +10951,7 @@ 0 - -38 + -60 2 @@ -8887,7 +10960,7 @@ 0 - -27 + -71 2 @@ -8896,7 +10969,7 @@ 0 - -27 + -71 2 @@ -8905,7 +10978,7 @@ 0 - -40 + -73 2 @@ -8914,7 +10987,7 @@ 0 - -40 + -73 2 @@ -8923,7 +10996,7 @@ 0 - -28 + -52 2 @@ -8932,7 +11005,7 @@ 0 - -28 + -52 2 @@ -8941,7 +11014,7 @@ 0 - -45 + -19 2 @@ -8950,7 +11023,25 @@ 0 - -45 + -19 + + + 2 + synopsis:)@] `#include <(:link + 1 + + 0 + + -35 + + + 2 + :)> [@(:include + 1 + + 0 + + -35 2 @@ -8977,7 +11068,7 @@ 0 - -10 + -37 2 @@ -8986,7 +11077,7 @@ 0 - -10 + -37 2 @@ -8995,7 +11086,7 @@ 0 - -11 + -54 2 @@ -9004,29 +11095,65 @@ 0 - -11 + -54 2 - synopsis:)@] `#include <(:link + synopsis:)@] `#include < 1 0 - -41 + -39 2 - :)> [@(:include + > (:include 1 0 - -41 + -39 2 - synopsis:)@] `#include <(:link + synopsis:) `#include < + 1 + + 0 + + -12 + + + 2 + > (:include + 1 + + 0 + + -12 + + + 2 + synopsis:) `#include < + 1 + + 0 + + -63 + + + 2 + > (:include + 1 + + 0 + + -63 + + + 2 + synopsis:) `#include < 1 0 @@ -9035,7 +11162,1685 @@ 2 - :)> (:include + > (:include + 1 + + 0 + + -23 + + + 2 + synopsis:) `#include < + 1 + + 0 + + -70 + + + 2 + > (:include + 1 + + 0 + + -70 + + + 2 + synopsis:) `#include < + 1 + + 0 + + -58 + + + 2 + > (:include + 1 + + 0 + + -58 + + + 2 + synopsis:) `#include < + 1 + + 0 + + -72 + + + 2 + > (:include + 1 + + 0 + + -72 + + + 2 + synopsis:) `#include < + 1 + + 0 + + -51 + + + 2 + > (:include + 1 + + 0 + + -51 + + + 2 + synopsis:) + + + + + 0 + + -76 + + + + 1 + 2 + (:auto !!:) (:pagelist tags="hpp" except_tags="noindex":) + + + + + 0 + + -77 + + + + 37 + 2 + [@#include < + 1 + + 0 + + -39 + + + 2 + > #include < + 1 + + 0 + + -12 + + + 2 + > #include < + 1 + + 0 + + -63 + + + 2 + > #include < + 1 + + 0 + + -23 + + + 2 + > #include < + 1 + + 0 + + -70 + + + 2 + > #include < + 1 + + 0 + + -58 + + + 2 + > #include < + 1 + + 0 + + -71 + + + 2 + > #include < + 1 + + 0 + + -54 + + + 2 + > #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:: + 1 + + 0 + + -16 + + + 2 + { }; 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 + 1 + + 0 + + -49 + + + 2 + ( file_open_error() << boost:: + 1 + + 0 + + -26 + + + 2 + ("fopen") << boost:: + 1 + + 0 + + -32 + + + 2 + (errno) << boost:: + 1 + + 0 + + -55 + + + 2 + (file) << boost:: + 1 + + 0 + + -66 + + + 2 + (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()) ) + 1 + + 0 + + -49 + + + 2 + ( file_read_error() << boost:: + 1 + + 0 + + -26 + + + 2 + ("fread") << boost:: + 1 + + 0 + + -32 + + + 2 + (errno) << boost:: + 1 + + 0 + + -36 + + + 2 + (f) ); return nr; }@] + + + + + + + + throws + + 82 + + reno_layer + + + + 73 + + + 0 + + -5 + + + + 0 + + + + + 0 + + -6 + + + + 0 + + + + + 0 + + -7 + + + + 0 + + + + + 0 + + -8 + + + + 0 + + + + + 0 + + -9 + + + + 0 + + + + + 0 + + -10 + + + + 0 + + + + + 0 + + -11 + + + + 0 + + + + + 0 + + -12 + + + + 0 + + + + + 0 + + -13 + + + + 0 + + + + + 0 + + -14 + + + + 0 + + + + + 0 + + -15 + + + + 0 + + + + + 0 + + -16 + + + + 0 + + + + + 0 + + -17 + + + + 0 + + + + + 0 + + -18 + + + + 1 + 2 + !!!!Throws: Any exception emitted by v's copy constructor. + + + + + 0 + + -19 + + + + 0 + + + + + 0 + + -20 + + + + 0 + + + + + 0 + + -21 + + + + 0 + + + + + 0 + + -22 + + + + 0 + + + + + 0 + + -23 + + + + 0 + + + + + 0 + + -24 + + + + 0 + + + + + 0 + + -25 + + + + 0 + + + + + 0 + + -26 + + + + 0 + + + + + 0 + + -27 + + + + 0 + + + + + 0 + + -28 + + + + 0 + + + + + 0 + + -29 + + + + 0 + + + + + 0 + + -30 + + + + 0 + + + + + 0 + + -31 + + + + 0 + + + + + 0 + + -32 + + + + 0 + + + + + 0 + + -33 + + + + 0 + + + + + 0 + + -34 + + + + 0 + + + + + 0 + + -35 + + + + 0 + + + + + 0 + + -36 + + + + 0 + + + + + 0 + + -37 + + + + 0 + + + + + 0 + + -38 + + + + 0 + + + + + 0 + + -39 + + + + 0 + + + + + 0 + + -40 + + + + 0 + + + + + 0 + + -41 + + + + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. + + + + + 0 + + -42 + + + + 0 + + + + + 0 + + -43 + + + + 1 + 2 + !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. + + + + + 0 + + -44 + + + + 0 + + + + + 0 + + -45 + + + + 0 + + + + + 0 + + -48 + + + + 0 + + + + + 0 + + -49 + + + + 0 + + + + + 0 + + -50 + + + + 0 + + + + + 0 + + -46 + + + + 0 + + + + + 0 + + -51 + + + + 0 + + + + + 0 + + -52 + + + + 0 + + + + + 0 + + -53 + + + + 0 + + + + + 0 + + -47 + + + + 0 + + + + + 0 + + -54 + + + + 0 + + + + + 0 + + -55 + + + + 0 + + + + + 0 + + -56 + + + + 0 + + + + + 0 + + -57 + + + + 0 + + + + + 0 + + -58 + + + + 0 + + + + + 0 + + -59 + + + + 0 + + + + + 0 + + -60 + + + + 0 + + + + + 0 + + -61 + + + + 0 + + + + + 0 + + -62 + + + + 0 + + + + + 0 + + -63 + + + + 0 + + + + + 0 + + -64 + + + + 0 + + + + + 0 + + -65 + + + + 0 + + + + + 0 + + -66 + + + + 0 + + + + + 0 + + -67 + + + + 0 + + + + + 0 + + -68 + + + + 0 + + + + + 0 + + -69 + + + + 0 + + + + + 0 + + -70 + + + + 0 + + + + + 0 + + -71 + + + + 0 + + + + + 0 + + -72 + + + + 0 + + + + + 0 + + -73 + + + + 0 + + + + + 0 + + -74 + + + + 0 + + + + + 0 + + -75 + + + + 0 + + + + + 0 + + -76 + + + + 0 + + + + + 0 + + -77 + + + + 0 + + + + + + + + synopsis + + 83 + + reno_layer + + + + 73 + + + 0 + + -5 + + + + 0 + + + + + 0 + + -6 + + + + 3 + 2 + `#include < + 1 + + 0 + + -52 + + + 2 + > [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -7 + + + + 0 + + + + + 0 + + -8 + + + + 3 + 2 + `#include < + 1 + + 0 + + -9 + + + 2 + > [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -9 + + + + 3 + 2 + [@#include <(:link + 1 + + 0 + + -64 + + + 2 + :)> namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -10 + + + + 0 + + + + + 0 + + -11 + + + + 0 + + + + + 0 + + -12 + + + + 3 + 2 + [@#include < + 1 + + 0 + + -60 + + + 2 + > namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -13 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -9 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -14 + + + + 0 + + + + + 0 + + -15 + + + + 0 + + + + + 0 + + -16 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -64 + + + 2 + :)> [@namespace boost { (:include def pre_indent="4":) }@] + + + + + 0 + + -17 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -9 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -18 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -71 + + + 2 + :)> [@(:include decl:)@] + + + + + 0 + + -19 + + + + 3 + 2 + [@#include <string> namespace boost { (:include + 1 + + 0 + + -16 + + + 2 + decl pre_indent="4":) (:include api pre_indent="4":) }@] + + + + + 0 + + -20 + + + + 0 + + + + + 0 + + -21 + + + + 0 + + + + + 0 + + -22 + + + + 3 + 2 + `#include < + 1 + + 0 + + -35 + + + 2 + > [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -23 + + + + 3 + 2 + [@#include < + 1 + + 0 + + -60 + + + 2 + > namespace boost { template <class> class weak_ptr; (:include api pre_indent="4":) }@] + + + + + 0 + + -24 + + + + 0 + + + + + 0 + + -25 + + + + 0 + + + + + 0 + + -26 + + + + 5 + 2 + `#include < + 1 + + 0 + + -39 + + + 2 + > (:include + 1 + + 0 + + -39 + + + 2 + synopsis:) + + + + + 0 + + -27 + + + + 1 + 2 + [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -28 + + + + 3 + 2 + `#include < + 1 + + 0 + + -37 + + + 2 + > [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -29 + + + + 0 + + + + + 0 + + -30 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -71 + + + 2 + :)> [@(:include decl:)@] + + + + + 0 + + -31 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -9 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -32 + + + + 5 + 2 + `#include < + 1 + + 0 + + -63 + + + 2 + > (:include + 1 + + 0 + + -63 + + + 2 + synopsis:) + + + + + 0 + + -33 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -9 + + + 2 + :)> [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -34 + + + + 0 + + + + + 0 + + -35 + + + + 1 + 2 + [@namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -36 + + + + 5 + 2 + `#include < + 1 + + 0 + + -23 + + + 2 + > (:include 1 0 @@ -9047,367 +12852,6 @@ synopsis:) - - - 0 - - -61 - - - - 1 - 2 - (:auto !!!:) (:include synopsis:) !!!!Requirements: This function must not be called outside of a catch block. !!!!Returns: A pointer of type E to the current exception object, or null if the current exception object can not be converted to E *. !!!!Throws: Nothing. - - - - - - - - throws - - 66 - - reno_layer - - - - 57 - - - 0 - - -5 - - - - 0 - - - - - 0 - - -6 - - - - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by T1..TN copy constructor. - - - - - 0 - - -7 - - - - 0 - - - - - 0 - - -8 - - - - 0 - - - - - 0 - - -9 - - - - 0 - - - - - 0 - - -10 - - - - 0 - - - - - 0 - - -11 - - - - 0 - - - - - 0 - - -12 - - - - 0 - - - - - 0 - - -13 - - - - 0 - - - - - 0 - - -14 - - - - 0 - - - - - 0 - - -15 - - - - 0 - - - - - 0 - - -18 - - - - 0 - - - - - 0 - - -19 - - - - 0 - - - - - 0 - - -20 - - - - 1 - 2 - !!!!Throws: std::bad_alloc, or any exception emitted by the T copy constructor. - - - - - 0 - - -21 - - - - 0 - - - - - 0 - - -22 - - - - 0 - - - - - 0 - - -23 - - - - 0 - - - - - 0 - - -24 - - - - 0 - - - - - 0 - - -25 - - - - 0 - - - - - 0 - - -26 - - - - 0 - - - - - 0 - - -27 - - - - 0 - - - - - 0 - - -28 - - - - 0 - - - - - 0 - - -29 - - - - 0 - - - - - 0 - - -30 - - - - 0 - - - - - 0 - - -31 - - - - 0 - - - - - 0 - - -32 - - - - 0 - - - - - 0 - - -33 - - - - 0 - - - - - 0 - - -34 - - - - 0 - - - - - 0 - - -35 - - - - 0 - - - - - 0 - - -36 - - - - 0 - - 0 @@ -9416,7 +12860,18 @@ - 0 + 3 + 2 + [@#include < + 1 + + 0 + + -64 + + + 2 + > namespace boost { (:include api pre_indent="4":) }@] @@ -9430,28 +12885,6 @@ 0 - - - 0 - - -17 - - - - 0 - - - - - 0 - - -16 - - - - 0 - - 0 @@ -9460,7 +12893,18 @@ - 0 + 3 + 2 + [@#include < + 1 + + 0 + + -60 + + + 2 + > namespace boost { (:include api pre_indent="4":) }@] @@ -9471,7 +12915,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -71 + + + 2 + :)> [@(:include decl:)@] @@ -9482,7 +12937,27 @@ - 0 + 5 + 2 + `#include <(:link + 1 + + 0 + + -73 + + + 2 + :)> [@namespace boost { (:include + 1 + + 0 + + -41 + + + 2 + decl pre_indent="4":) }@] @@ -9504,7 +12979,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -71 + + + 2 + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] @@ -9529,6 +13015,81 @@ 0 + + + 0 + + -48 + + + + 5 + 2 + `#include < + 1 + + 0 + + -72 + + + 2 + > (:include + 1 + + 0 + + -72 + + + 2 + synopsis:) + + + + + 0 + + -49 + + + + 3 + 2 + `#include < + 1 + + 0 + + -54 + + + 2 + > (:include decl:) + + + + + 0 + + -50 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -19 + + + 2 + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + + 0 @@ -9540,50 +13101,6 @@ 0 - - - 0 - - -47 - - - - 0 - - - - - 0 - - -48 - - - - 0 - - - - - 0 - - -49 - - - - 0 - - - - - 0 - - -50 - - - - 0 - - 0 @@ -9591,907 +13108,12 @@ -51 - - 0 - - - - - 0 - - -52 - - - - 0 - - - - - 0 - - -53 - - - - 0 - - - - - 0 - - -54 - - - - 0 - - - - - 0 - - -55 - - - - 0 - - - - - 0 - - -56 - - - - 0 - - - - - 0 - - -57 - - - - 0 - - - - - 0 - - -58 - - - - 1 - 2 - !!!!Throws: Any exception emitted by v's copy constructor. - - - - - 0 - - -59 - - - - 0 - - - - - 0 - - -60 - - - - 0 - - - - - 0 - - -61 - - - - 0 - - - - - - - - synopsis - - 67 - - reno_layer - - - - 57 - - - 0 - - -5 - - - - 0 - - - - - 0 - - -6 - - - - 5 - 2 - `#include <(:link - 1 - - 0 - - -40 - - - 2 - :)> [@namespace boost { (:include - 1 - - 0 - - -6 - - - 2 - decl pre_indent="4":) }@] - - - - - 0 - - -7 - - - - 0 - - - - - 0 - - -8 - - - - 0 - - - - - 0 - - -9 - - - - 1 - 2 - [@namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -10 - - - - 3 - 2 - [@#include <(:link - 1 - - 0 - - -34 - - - 2 - :)> namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -11 - - - - 3 - 2 - [@#include < - 1 - - 0 - - -34 - - - 2 - > namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -12 - - - - 0 - - - - - 0 - - -13 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -34 - - - 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] - - - - - 0 - - -14 - - - - 0 - - - - - 0 - - -15 - - - - 0 - - - - - 0 - - -18 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -45 - - - 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -19 - - - - 0 - - - - - 0 - - -20 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -27 - - - 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -21 - - - - 0 - - - - - 0 - - -22 - - - - 0 - - - - - 0 - - -23 - - 1 2 [@(:include api:)@] - - - 0 - - -24 - - - - 0 - - - - - 0 - - -25 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -10 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -26 - - - - 0 - - - - - 0 - - -27 - - - - 3 - 2 - [@#include <(:link - 1 - - 0 - - -34 - - - 2 - :)> namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -28 - - - - 3 - 2 - [@#include < - 1 - - 0 - - -34 - - - 2 - > namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -29 - - - - 0 - - - - - 0 - - -30 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -27 - - - 2 - :)> [@(:include decl:)@] - - - - - 0 - - -31 - - - - 1 - 2 - [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -32 - - - - 3 - 2 - `#include < - 1 - - 0 - - -41 - - - 2 - > (:include decl:) - - - - - 0 - - -33 - - - - 3 - 2 - `#include < - 1 - - 0 - - -28 - - - 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -34 - - - - 1 - 2 - [@namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -35 - - - - 0 - - - - - 0 - - -36 - - - - 3 - 2 - `#include < - 1 - - 0 - - -10 - - - 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -37 - - - - 1 - 2 - [@#include <boost/shared_ptr.hpp> namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -38 - - - - 1 - 2 - [@namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -17 - - - - 0 - - - - - 0 - - -16 - - - - 0 - - - - - 0 - - -39 - - - - 0 - - - - - 0 - - -40 - - - - 3 - 2 - [@#include < - 1 - - 0 - - -27 - - - 2 - > #include <boost/tuple/tuple.hpp> namespace boost { (:include api pre_indent="4":) }@] - - - - - 0 - - -41 - - - - 1 - 2 - (:include api:) - - - - - 0 - - -42 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -10 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -43 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -27 - - - 2 - :)> [@(:include decl:)@] - - - - - 0 - - -44 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -27 - - - 2 - :)> [@namespace boost { (:include def pre_indent="4":) }@] - - - - - 0 - - -45 - - - - 3 - 2 - [@#include <string> namespace boost { (:include - 1 - - 0 - - -13 - - - 2 - decl pre_indent="4":) (:include api pre_indent="4":) }@] - - - - - 0 - - -46 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -10 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -47 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -10 - - - 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -48 - - - - 0 - - - - - 0 - - -49 - - - - 0 - - - - - 0 - - -50 - - - - 3 - 2 - `#include <(:link - 1 - - 0 - - -45 - - - 2 - :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] - - - - - 0 - - -51 - - - - 0 - - 0 @@ -10502,16 +13124,16 @@ 3 2 - `#include <(:link + [@#include < 1 0 - -10 + -64 2 - :)> [@namespace boost { (:include decl pre_indent="4":) }@] + > namespace boost { (:include api pre_indent="4":) }@] @@ -10529,11 +13151,22 @@ 0 - -41 + -9 2 - :)> [@namespace boost { (:include decl:) }@] + :)> [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -47 + + + + 0 @@ -10544,7 +13177,9 @@ - 0 + 1 + 2 + (:include api:) @@ -10555,18 +13190,27 @@ - 3 + 5 2 `#include < 1 0 - -11 + -70 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] + > (:include + 1 + + 0 + + -70 + + + 2 + synopsis:) @@ -10577,7 +13221,9 @@ - 0 + 1 + 2 + [@namespace boost { (:include decl pre_indent="4":) }@] @@ -10588,7 +13234,18 @@ - 0 + 3 + 2 + `#include <(:link + 1 + + 0 + + -54 + + + 2 + :)> [@namespace boost { (:include decl:) }@] @@ -10601,16 +13258,16 @@ 3 2 - `#include <(:link + [@#include < 1 0 - -27 + -60 2 - :)> [@(:include decl:)@] + > #include <string> namespace boost { (:include api pre_indent="4":) }@] @@ -10632,7 +13289,9 @@ - 0 + 1 + 2 + [@namespace boost { (:include api pre_indent="4":) }@] @@ -10645,16 +13304,300 @@ 3 2 + `#include <(:link + 1 + + 0 + + -19 + + + 2 + :)>\\ [@namespace boost { (:include decl pre_indent="4":) }@] + + + + + 0 + + -62 + + + + 0 + + + + + 0 + + -63 + + + + 3 + 2 + [@#include < + 1 + + 0 + + -60 + + + 2 + > #include <errno.h> namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -64 + + + + 1 + 2 + [@namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -65 + + + + 5 + 2 `#include < 1 0 - -9 + -12 2 - > [@namespace boost { (:include decl pre_indent="4":) }@] + > (:include + 1 + + 0 + + -12 + + + 2 + synopsis:) + + + + + 0 + + -66 + + + + 5 + 2 + `#include < + 1 + + 0 + + -58 + + + 2 + > (:include + 1 + + 0 + + -58 + + + 2 + synopsis:) + + + + + 0 + + -67 + + + + 3 + 2 + `#include <(:link + 1 + + 0 + + -71 + + + 2 + :)> [@namespace boost { (:include def pre_indent="4":) }@] + + + + + 0 + + -68 + + + + 0 + + + + + 0 + + -69 + + + + 0 + + + + + 0 + + -70 + + + + 3 + 2 + [@#include < + 1 + + 0 + + -60 + + + 2 + > #include <string> namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -71 + + + + 3 + 2 + [@#include <(:link + 1 + + 0 + + -64 + + + 2 + :)> namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -72 + + + + 3 + 2 + [@#include < + 1 + + 0 + + -60 + + + 2 + > #include <string> namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -73 + + + + 3 + 2 + [@#include < + 1 + + 0 + + -71 + + + 2 + > #include <boost/tuple/tuple.hpp> namespace boost { (:include api pre_indent="4":) }@] + + + + + 0 + + -74 + + + + 0 + + + + + 0 + + -75 + + + + 0 + + + + + 0 + + -76 + + + + 0 + + + + + 0 + + -77 + + + + 0 @@ -10667,14 +13610,14 @@ - 68 + 84 reno_context_map - 57 + 73 -5 @@ -10708,6 +13651,12 @@ -15 + + -16 + + + -17 + -18 @@ -10771,12 +13720,6 @@ -38 - - -17 - - - -16 - -39 @@ -10798,12 +13741,6 @@ -45 - - -46 - - - -47 - -48 @@ -10813,6 +13750,9 @@ -50 + + -46 + -51 @@ -10822,6 +13762,9 @@ -53 + + -47 + -54 @@ -10846,11 +13789,59 @@ -61 + + -62 + + + -63 + + + -64 + + + -65 + + + -66 + + + -67 + + + -68 + + + -69 + + + -70 + + + -71 + + + -72 + + + -73 + + + -74 + + + -75 + + + -76 + + + -77 + - 57 + 73 @@ -10865,7 +13856,7 @@ - -12 + -44 @@ -10882,7 +13873,24 @@ - -21 + -24 + + + + + + + 0 + + + + + + 1 + + + + -69 @@ -10916,7 +13924,7 @@ - -8 + -52 @@ -10933,7 +13941,7 @@ - -28 + -37 @@ -10950,7 +13958,41 @@ - -11 + -45 + + + + + + + 0 + + + + + + 1 + + + + -5 + + + + + + + 0 + + + + + + 1 + + + + -46 @@ -10970,6 +14012,57 @@ -15 + + + + + 0 + + + + + + 1 + + + + -21 + + + + + + + 0 + + + + + + 1 + + + + -76 + + + + + + + 0 + + + + + + 1 + + + + -34 + + @@ -11001,109 +14094,7 @@ - -16 - - - - - - - 0 - - - - - - 1 - - - - -17 - - - - - - - 0 - - - - - - 1 - - - - -29 - - - - - - - 0 - - - - - - 1 - - - - -39 - - - - - - - 0 - - - - - - 1 - - - - -19 - - - - - - - 0 - - - - - - 1 - - - - -48 - - - - - - - 0 - - - - - - 1 - - - - -60 + -75 @@ -11127,7 +14118,7 @@ - -45 + -19 @@ -11151,7 +14142,83 @@ - -10 + -9 + + + + + + + 1 + 66EFC83C830F0B00D0C9399B475099072E2674B3C694F9152645A33E3D7AC303 + 561674611 + 417 + 323 + + + + + + 0 + ../../../../boost/exception/errinfo_file_name.hpp + 0 + 0 + + + + -70 + + + + + + + 2 + EEA69AA1E84CB2B7C903A3F4C236D0A233D03DBA4BA1D3B97D959918F3B30E09 + 2728032055 + 406 + 344 + EE695B95A2499B66980754857E184776F1DE7224372A5F5153B6DF94E621A89B + 1009590890 + 92 + 308 + + + + + + 0 + ../../../../boost/exception/errinfo_file_open_mode.hpp + 0 + 0 + + + + -66 + + + + + + + 1 + 21A43755562CB78B3FFCC49F66B457C1FCD659EE98F25BBFA8DDE453EB89DF0E + 2576704708 + 337 + 323 + + + + + + 0 + ../../../../boost/exception/errinfo_api_function.hpp + 0 + 0 + + + + -39 @@ -11179,7 +14246,7 @@ - -46 + -31 @@ -11207,7 +14274,7 @@ - -52 + -17 @@ -11235,7 +14302,7 @@ - -47 + -53 @@ -11263,7 +14330,7 @@ - -36 + -8 @@ -11291,7 +14358,7 @@ - -25 + -33 @@ -11319,7 +14386,7 @@ - -42 + -13 @@ -11343,7 +14410,7 @@ - -57 + -38 @@ -11351,10 +14418,10 @@ 1 - 9E8DCE3BCF462A3A332DA70F61E46FA5C2AB791B95E33D3F2AF1307F53C84B1C - 1960675522 - 6483 - 591 + 80C86365052AA49654F75CAA87BF9B29C6373A01F8EE4D5E79F317CD76FC0718 + 622934727 + 6161 + 412 @@ -11367,7 +14434,59 @@ - -24 + -7 + + + + + + + 1 + F812D8AE60189369CED7A3FD72733A65B57D56637E6721867F52A82EB319731A + 3974553696 + 1432 + 352 + + + + + + 0 + ../../example/errinfos.cpp + 0 + 0 + + + + -77 + + + + + + + 2 + 126A895281064E2195458B8A47CD73DB7E3BE3608F250925E07AF4230CBDDE1D + 4231421785 + 307 + 344 + 16179B125E2BC6D993FBE4BA5E9A96DBAE43CA1443C7D281B659D020B6725983 + 1126376090 + 92 + 209 + + + + + + 0 + ../../../../boost/exception/errinfo_type_info_name.hpp + 0 + 0 + + + + -48 @@ -11395,7 +14514,7 @@ - -58 + -18 @@ -11423,7 +14542,7 @@ - -20 + -43 @@ -11431,23 +14550,47 @@ 1 - D9B8E6AA12A4F33953B1A961FA590C5A3840234B6531CA8C04AC985AD5800835 - 2432554768 - 702 - 408 + 283AE6BE0920B1882100C426958FDF998DEE10226546B300B45C1A26B242FC25 + 722381934 + 617 + 323 0 - ../../example/enable_error_info.cpp + ../../../../boost/exception/errinfo_errno.hpp 0 0 - -5 + -63 + + + + + + + 1 + D194983FA4C182AB869F1AB542797B3EDCCBAEB0A6E67B2DCEE5EA2C7F58853C + 1308852571 + 395 + 307 + + + + + + 0 + ../../example/cloning_1.cpp + 0 + 0 + + + + -25 @@ -11475,7 +14618,7 @@ - -61 + -22 @@ -11503,7 +14646,83 @@ - -31 + -56 + + + + + + + 2 + 15CF5BD93D20D62D659C11A69330B06E408398EA488BEF1FD45437AADCDB424E + 1232553666 + 214 + 345 + 6262783847165581298EC9500031E6B7A97B2751A9CEF67C4794121A78142C58 + 3676119191 + 90 + 118 + + + + + + 0 + ../../../../boost/exception/errinfo_file_handle.hpp + 0 + 0 + + + + -36 + + + + + + + 1 + 28E8289766B2CDAEF0A407A6389CB9F7FD3B0F4B49B15CB73AF210A1CEB60C58 + 4196332848 + 735 + 363 + + + + + + 0 + ../../example/info_tuple.cpp + 0 + 0 + + + + -10 + + + + + + + 1 + 66E0BD9724AB83012F5B35D887E3313960DC0E69B94E0C03CA1F3C85A0D84A5C + 2883671483 + 311 + 306 + + + + + + 0 + ../../example/logging.cpp + 0 + 0 + + + + -74 @@ -11531,7 +14750,163 @@ - -50 + -61 + + + + + + + 1 + 4EDD3DF2332B6D9D22AC9AD90B850ACC715A24DD466E675014CBED25C63C255F + 4175717823 + 328 + 323 + + + + + + 0 + ../../../../boost/exception/errinfo_type_info_name.hpp + 0 + 0 + + + + -72 + + + + + + + 2 + 21027A2B73C9AA6FF083752A952D63BBA9B5FD68A3C8915965A7184EA62A5D61 + 1523356166 + 537 + 403 + 24256E1CE56594FB38D0630858B8947191827CFC57771E8727A6A56F76207454 + 665917505 + 66 + 26 + + + + + + 0 + ../../../../boost/exception/errinfo_errno.hpp + 0 + 0 + + + + -32 + + + + + + + 1 + 2CCD2A79129C832AB12435E43BB35DE67318A8940A36530EF83C5E617987D661 + 2091122505 + 699 + 323 + + + + + + 0 + ../../../../boost/exception/all.hpp + 0 + 0 + + + + -51 + + + + + + + 2 + AEDDD2FA4F47CEBD99444F1054D85AB8132748CF38D6634503D62E9C8AD5FE68 + 1378637100 + 292 + 368 + 892C0239798B84BA2E80DAA70BBEB7BE0B6086A1D0829D0E1937EC1D19E3FF20 + 3349881047 + 89 + 197 + + + + + + 0 + ../../../../boost/exception/errinfo_api_function.hpp + 0 + 0 + + + + -26 + + + + + + + 1 + E0BE7EFCD5550582AB95C9EEDA6E68CA0F89B19838DA61876D42161E1EA4AE71 + 2587249979 + 233 + 323 + + + + + + 0 + ../../../../boost/exception/errinfo_at_line.hpp + 0 + 0 + + + + -12 + + + + + + + 2 + E0BE7EFCD5550582AB95C9EEDA6E68CA0F89B19838DA61876D42161E1EA4AE71 + 2587249979 + 233 + 323 + 92AB508A6B1C2A62CB2ACED423BD04BB5A471674B5A51BFC1E6FB1F5C92AF9AA + 2372475309 + 70 + 157 + + + + + + 0 + ../../../../boost/exception/errinfo_at_line.hpp + 0 + 0 + + + + -65 @@ -11559,7 +14934,7 @@ - -18 + -50 @@ -11567,41 +14942,17 @@ 1 - 7116AEECEA666794E31DC99390ADEC1BA6AF74B2398067A0739767B4B76FA97A - 4128134227 - 307 - 302 + FFF4359EFC66EE6AA729B641F38B4020A55E83A1C099BCA59B1CA9A9875E7F79 + 366628170 + 236 + 323 0 - ../../example/logging.cpp - 0 - 0 - - - - -49 - - - - - - - 1 - F647827E95C64B626A8E3751AD4E4D21237DD17482EEA6DB93A16A2C6AC79E87 - 527078204 - 446 - 227 - - - - - - 0 - ../../../../boost/exception.hpp + ../../../../boost/exception/errinfo_file_handle.hpp 0 0 @@ -11615,83 +14966,23 @@ 1 - D10E536B909EFFF78FB09E6242AEC7C74ACDD75AE7DF32B45870422B752E5D8E - 1903336130 - 557 - 382 + 0F429704770B5772E81B2BC74E962B62F83826D6C885B7C6E7186D127D31B291 + 1345125619 + 854 + 306 0 - ../../example/error_info_1.cpp + ../../example/error_info_2.cpp 0 0 - -26 - - - - - - - 2 - 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A - 1770110914 - 587 - 1467 - 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D - 3929437933 - 361 - 213 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - -53 - - - - - - - 3 - 612485E090D76B2CC43C1A296F813075BA165C2496082E78E939F10B3DA8E09A - 1770110914 - 587 - 1467 - 60F3F48B87487FA6E0D2CCC0750AF435CC92CEC80BBBF609AC71295031AADD0D - 3929437933 - 361 - 213 - CD1241D84950468704F3C3F04116B8DA5162A8BEA4364F10951232F49113C5DE - 1658463867 - 121 - 238 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - -51 + -29 @@ -11715,7 +15006,55 @@ - -9 + -35 + + + + + + + 1 + DE766B811244919E8E1EA54FC747A8487BCE57F1AB592932640FC90428B617A5 + 414875037 + 427 + 323 + + + + + + 0 + ../../../../boost/exception/errinfo_file_open_mode.hpp + 0 + 0 + + + + -58 + + + + + + + 1 + 977045132A532A0071B0B53F737D85367CE9A331402F96790E45B3B6F2FC88A6 + 1875939463 + 529 + 382 + + + + + + 0 + ../../example/error_info_1.cpp + 0 + 0 + + + + -62 @@ -11743,7 +15082,7 @@ - -44 + -67 @@ -11775,7 +15114,7 @@ - -43 + -30 @@ -11807,7 +15146,67 @@ - -30 + -40 + + + + + + + 2 + DA1CAA5F6BAB712AD89E8A0B7D83961FCE4AF9FD198791C9F6EA299800A64FAC + 3553871704 + 612 + 1496 + 154AC930BD1FDCADE24CDB07DBD3163CA26378AF4F1D428C34B67D1F68A60891 + 50905072 + 586 + 23 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + -57 + + + + + + + 3 + DA1CAA5F6BAB712AD89E8A0B7D83961FCE4AF9FD198791C9F6EA299800A64FAC + 3553871704 + 612 + 1496 + 154AC930BD1FDCADE24CDB07DBD3163CA26378AF4F1D428C34B67D1F68A60891 + 50905072 + 586 + 23 + CD1241D84950468704F3C3F04116B8DA5162A8BEA4364F10951232F49113C5DE + 1658463867 + 121 + 453 + + + + + + 0 + ../../../../boost/throw_exception.hpp + 0 + 0 + + + + -68 @@ -11831,7 +15230,7 @@ - -37 + -27 @@ -11855,175 +15254,7 @@ - -27 - - - - - - - 1 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - -34 - - - - - - - 2 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - 17E691632123EB67BA67D590B49EB8094F462F5A10A66A1C5438E1867EF1478E - 765399792 - 77 - 5917 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - -54 - - - - - - - 2 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - DF9EA87B0140AACF4422F1B76F6A6A409C15F32858BBBA85A35981A824C56BA9 - 1137981799 - 192 - 8994 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - -55 - - - - - - - 2 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - F3FB15CD82336271C6E875BC620385322777D16F0B7C233300783CE35710CCBF - 3292878997 - 282 - 7305 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - -33 - - - - - - - 2 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 - 1693870740 - 2195 - 3720 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - -13 - - - - - - - 3 - 55F1164770FD778354E151EF65A3E830DA20F325F7ED20A95130A4B83FC801BF - 1282550303 - 9192 - 323 - 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 - 1693870740 - 2195 - 3720 - DA154372D8C23BD9EDC30005CA7959CE686D198891097A837D006B5222F04DE9 - 2768248809 - 143 - 60 - - - - - - 0 - ../../../../boost/exception/exception.hpp - 0 - 0 - - - - -35 + -71 @@ -12047,7 +15278,7 @@ - -40 + -73 @@ -12055,57 +15286,9 @@ 1 - 4ED9709788BBAB4DE7CF336561606B8C0B41F70877A3395F4EE026F4AEB66CC6 - 743998427 - 409 - 307 - - - - - - 0 - ../../example/cloning_1.cpp - 0 - 0 - - - - -22 - - - - - - - 1 - 04DDC793002AFCF4F4166D250C67D09B6FE8B86224318ED7847AD6EC423B70CA - 922651615 - 433 - 1032 - - - - - - 0 - ../../../../boost/throw_exception.hpp - 0 - 0 - - - - -32 - - - - - - - 1 - BEFF039468E0E9A3719E5CB51DA9710812D146B587BAF573D1670908BB97C0CA - 35548578 - 1983 + A95165313334B684C85659D05D3D8EB17F4AF552EDCB3C180AC1F85D18C99CBF + 115507474 + 2037 91 @@ -12119,7 +15302,7 @@ - -41 + -54 @@ -12127,23 +15310,243 @@ 1 - F4C951B28F7DE500973AA3DFAA99F2BADA6EDAFA2B406C30BEF3B7FBE6FD57D7 - 2263754923 - 982 - 306 + 04DDC793002AFCF4F4166D250C67D09B6FE8B86224318ED7847AD6EC423B70CA + 922651615 + 433 + 1061 0 - ../../example/error_info_2.cpp + ../../../../boost/throw_exception.hpp 0 0 - -7 + -49 + + + + + + + 1 + 625285100233119FB4542EB54530FC7CB802D9A50B06D6CFB397730CDB1ED7D8 + 4080542391 + 9174 + 323 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + -64 + + + + + + + 2 + 625285100233119FB4542EB54530FC7CB802D9A50B06D6CFB397730CDB1ED7D8 + 4080542391 + 9174 + 323 + 17E691632123EB67BA67D590B49EB8094F462F5A10A66A1C5438E1867EF1478E + 765399792 + 77 + 5899 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + -11 + + + + + + + 2 + 625285100233119FB4542EB54530FC7CB802D9A50B06D6CFB397730CDB1ED7D8 + 4080542391 + 9174 + 323 + DF9EA87B0140AACF4422F1B76F6A6A409C15F32858BBBA85A35981A824C56BA9 + 1137981799 + 192 + 8976 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + -28 + + + + + + + 2 + 625285100233119FB4542EB54530FC7CB802D9A50B06D6CFB397730CDB1ED7D8 + 4080542391 + 9174 + 323 + F3FB15CD82336271C6E875BC620385322777D16F0B7C233300783CE35710CCBF + 3292878997 + 282 + 7287 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + -6 + + + + + + + 2 + 625285100233119FB4542EB54530FC7CB802D9A50B06D6CFB397730CDB1ED7D8 + 4080542391 + 9174 + 323 + 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 + 1693870740 + 2195 + 3702 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + -16 + + + + + + + 3 + 625285100233119FB4542EB54530FC7CB802D9A50B06D6CFB397730CDB1ED7D8 + 4080542391 + 9174 + 323 + 65D35B8A2063883A53E9D0DCC3FF8E5CA3573A58451A653CDE3003FFBEC576D3 + 1693870740 + 2195 + 3702 + DA154372D8C23BD9EDC30005CA7959CE686D198891097A837D006B5222F04DE9 + 2768248809 + 143 + 60 + + + + + + 0 + ../../../../boost/exception/exception.hpp + 0 + 0 + + + + -42 + + + + + + + 2 + 307034E20863A00923777A60D9495B4076B7F917D5B97203025299060F0833E0 + 3948311309 + 396 + 344 + F8ED2052577830AC0C515EC5932BB14445DD5DA714782281FCDB1776961FECB1 + 3880328768 + 82 + 308 + + + + + + 0 + ../../../../boost/exception/errinfo_file_name.hpp + 0 + 0 + + + + -55 + + + + + + + 1 + C95CEF2E9D0BAA1E950509471062916DB849A46A19F7692BA478030E79B338EB + 1917376632 + 706 + 408 + + + + + + 0 + ../../example/enable_error_info.cpp + 0 + 0 + + + + -47 @@ -12171,7 +15574,7 @@ - -38 + -60 @@ -12199,7 +15602,7 @@ - -6 + -41 @@ -12207,23 +15610,23 @@ 1 - E444EE9697EEADFDE0767E1D0242FC0E70D98E61FB1F0FFA099648DE509B82F3 - 94503238 - 773 - 374 + F39D869016327CDFEA720920B2743F47989202BF5814B6556EC54A1B0FE562F8 + 3703518029 + 147 + 323 0 - ../../example/info_tuple.cpp + ../../../../boost/exception.hpp 0 0 - -56 + -20 @@ -12233,14 +15636,14 @@ - 69 + 85 tag_index - 48 + 55 1 @@ -12265,15 +15668,6 @@ error_info free function - - - 0 - - -7 - - - noalso noindex tutorial - 0 @@ -12281,7 +15675,7 @@ -8 - + type @@ -12299,7 +15693,7 @@ -10 - + noalso noindex tutorial @@ -12308,16 +15702,7 @@ -11 - exception_ptr - - - - 0 - - -12 - - - noindex + function @@ -12326,7 +15711,7 @@ -13 - type + exception_ptr free function @@ -12335,7 +15720,25 @@ -14 - tutorial + + + + + 0 + + -16 + + + type + + + + 0 + + -17 + + + exception_ptr free function @@ -12344,7 +15747,16 @@ -18 - function + function member + + + + 0 + + -19 + + + @@ -12353,16 +15765,7 @@ -20 - error_info free function - - - - 0 - - -21 - - - tutorial + noindex @@ -12371,292 +15774,13 @@ -22 - noindex tutorial - - - - 0 - - -23 - - - - - - - 0 - - -25 - - - exception_ptr free function - - - - 0 - - -26 - - - noalso noindex tutorial - - - - 0 - - -27 - - - - - - - 0 - - -28 - - - error_info - - - - 0 - - -30 - - - function member - - - - 0 - - -31 - - - error_info free function - - - - 0 - - -32 - - - macro - - - - 0 - - -33 - - - error_info free function - - - - 0 - - -34 - - - - - - - 0 - - -35 - - function 0 - -36 - - - type - - - - 0 - - -37 - - - error_info - - - - 0 - - -38 - - - - - - - 0 - - -40 - - - - - - - 0 - - -41 - - - - - - - 0 - - -42 - - - exception_ptr free function - - - - 0 - - -43 - - - type - - - - 0 - - -44 - - - type - - - - 0 - - -45 - - - - - - - 0 - - -46 - - - exception_ptr type - - - - 0 - - -47 - - - type - - - - 0 - - -49 - - - diagnostic_information tutorial - - - - 0 - - -50 - - - diagnostic_information free function - - - - 0 - - -52 - - - exception_ptr free function - - - - 0 - - -53 - - - free function - - - - 0 - - -54 - - - function - - - - 0 - - -55 - - - exception_ptr free function - - - - 0 - - -56 - - - noalso noindex tutorial - - - - 0 - - -57 - - - noindex tutorial - - - - 0 - - -58 - - - function member - - - - 0 - - -59 + -24 tutorial @@ -12665,11 +15789,353 @@ 0 - -61 + -25 + + + noindex tutorial + + + + 0 + + -26 + + + error_info_instance noalso type + + + + 0 + + -27 + + + error_info + + + + 0 + + -28 + + + exception_ptr free function + + + + 0 + + -29 + + + noalso noindex tutorial + + + + 0 + + -30 + + + type + + + + 0 + + -31 + + + exception_ptr type + + + + 0 + + -32 + + + error_info_instance noalso type + + + + 0 + + -33 + + + exception_ptr free function + + + + 0 + + -35 + + + + + + + 0 + + -36 + + + error_info_instance noalso type + + + + 0 + + -37 + + + exception_ptr + + + + 0 + + -38 + + + noindex tutorial + + + + 0 + + -40 + + + function member + + + + 0 + + -41 + + + error_info free function + + + + 0 + + -42 function + + + 0 + + -43 + + + error_info free function + + + + 0 + + -44 + + + noindex + + + + 0 + + -48 + + + error_info_instance noalso type + + + + 0 + + -49 + + + macro + + + + 0 + + -50 + + + function + + + + 0 + + -52 + + + error_info + + + + 0 + + -53 + + + type + + + + 0 + + -47 + + + tutorial + + + + 0 + + -54 + + + + + + + 0 + + -55 + + + error_info_instance noalso type + + + + 0 + + -56 + + + error_info free function + + + + 0 + + -57 + + + free function + + + + 0 + + -60 + + + + + + + 0 + + -61 + + + diagnostic_information free function + + + + 0 + + -62 + + + noalso noindex tutorial + + + + 0 + + -64 + + + + + + + 0 + + -65 + + + error_info_instance noalso type + + + + 0 + + -66 + + + error_info_instance noalso type + + + + 0 + + -67 + + + type + + + + 0 + + -69 + + + tutorial + + + + 0 + + -71 + + + + + + + 0 + + -73 + + + + + + + 0 + + -74 + + + diagnostic_information tutorial + diff --git a/doc/synopsis.html b/doc/synopsis.html index c617031..9f6bde3 100644 --- a/doc/synopsis.html +++ b/doc/synopsis.html @@ -38,9 +38,9 @@ boost template <class Tag,class T> class error_info; - typedef error_info<struct tag_throw_function,char const *> throw_function; - typedef error_info<struct tag_throw_file,char const *> throw_file; - typedef error_info<struct tag_throw_line,int> throw_line; + 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; }

#include <boost/exception/error_info.hpp>

namespace
@@ -172,14 +172,82 @@ boost
     void throw_exception( E const & e );
 #endif
     }
-

#include <boost/exception.hpp>

+

#include <boost/exception/errinfo_api_function.hpp>

+
#include <boost/exception/error_info.hpp>
+
+namespace
+boost
+    {
+    typedef error_info<struct errinfo_api_function_,int> errinfo_api_function;
+    }
+

#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;
+    }
+

#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;
+    }
+

#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;
+    }
+

#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;
+    }
+

#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;
+    }
+

#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;
+    }
+

#include <boost/exception/all.hpp>


See Also:

The returned string is not presentable as a friendly user message, but because it is generated automatically, it is useful for debugging or logging purposes. Here is an example:

-
#include <boost/exception.hpp>
+
#include <boost/exception/all.hpp>
 #include <iostream>
 
 void f(); //throws unknown types that derive from boost::exception.
@@ -47,13 +47,13 @@ g()
     }

Example:

this is a possible output from the diagnostic_information function, as used in libs/exception/example/example_io.cpp:

-
example_io.cpp(83): 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<class fopen_error>
+
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 tag_errno *] = 2, OS says "No such file or directory"
-[struct tag_file_name *] = tmp1.txt
-[struct tag_function *] = fopen
-[struct tag_open_mode *] = rb
+[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

See Also:

Boost Exception
diff --git a/doc/tutorial_enable_error_info.html b/doc/tutorial_enable_error_info.html index 1dceb6d..b14056e 100644 --- a/doc/tutorial_enable_error_info.html +++ b/doc/tutorial_enable_error_info.html @@ -22,7 +22,7 @@

Integrating Boost Exception in Existing Exception Class Hierarchies

Some exception hierarchies can not be modified to make boost::exception a base type. In this case, the enable_error_info function template can be used to make exception objects derive from boost::exception anyway. Here is an example:

-
#include <boost/exception.hpp>
+
#include <boost/exception/all.hpp>
 #include <stdexcept>
 
 typedef boost::error_info<struct tag_std_range_min,size_t> std_range_min;
diff --git a/doc/tutorial_exception_ptr.html b/doc/tutorial_exception_ptr.html
index 85fe37e..4cc9ef9 100644
--- a/doc/tutorial_exception_ptr.html
+++ b/doc/tutorial_exception_ptr.html
@@ -28,19 +28,18 @@
 

Here is how cloning can be enabled in a throw-expression (15.1):

#include <boost/exception/info.hpp>
+#include <boost/exception/errinfo_errno.hpp>
 #include <stdio.h>
 #include <errno.h>
 
-typedef boost::error_info<struct tag_errno,int> errno_info;
-
-class file_read_error: public boost::exception { };
+struct file_read_error: virtual boost::exception { };
 
 void
 file_read( FILE * f, void * buffer, size_t size )
     {
     if( size!=fread(buffer,1,size,f) )
         throw boost::enable_current_exception(file_read_error()) <<
-            errno_info(errno);
+            boost::errinfo_errno(errno);
     }

Of course, enable_current_exception may be used with any exception type; there is no requirement that it should derive from boost::exception.

Cloning and Re-Throwing an Exception

diff --git a/doc/tutorial_transporting_data.html b/doc/tutorial_transporting_data.html index 0ab9f62..5ed6fa6 100644 --- a/doc/tutorial_transporting_data.html +++ b/doc/tutorial_transporting_data.html @@ -29,24 +29,22 @@

Adding of Arbitrary Data at the Point of the Throw

The following example demonstrates how errno can be stored in exception objects using Boost Exception:

-
#include <boost/exception.hpp>
-#include <errno.h>
+
#include <boost/exception/all.hpp>
 #include <iostream>
 
-typedef boost::error_info<struct tag_errno,int> errno_info; //(1)
+typedef boost::error_info<struct tag_my_info,int> my_info; //(1)
 
-class my_error: public boost::exception, public std::exception { }; //(2)
+struct my_error: virtual boost::exception, virtual std::exception { }; //(2)
 
 void
 f()
     {
-    throw my_error() << errno_info(errno); //(3)
-    }
-
-

First, we instantiate the error_info template using a unique identifier -- tag_errno, and the type of the info it identifies -- int. This provides compile-time type safety for the various values stored in exception objects.

+ throw my_error() << my_info(42); //(3) + }
+

First, we instantiate the error_info template using a unique identifier -- tag_my_info, and the type of the info it identifies -- int. This provides compile-time type safety for the various values stored in exception objects.

Second, we define class my_error, which derives from boost::exception.

Finally, (3) illustrates how the typedef from (1) can be used with operator<< to store values in exception objects at the point of the throw.

-

The stored errno value can be recovered at a later time like this:

+

The stored my_info value can be recovered at a later time like this:

// ...continued
 
 void
@@ -59,8 +57,8 @@ g()
     catch(
     my_error & x )
         {
-        if( int const * err=boost::get_error_info<errno_info>(x) )
-            std::cerr << "Error code: " << *err;
+        if( int const * mi=boost::get_error_info<my_info>(x) )
+            std::cerr << "My info: " << *mi;
         }
     }

The get_error_info function template is instantiated with the typedef from (1), and is passed an exception object of a polymorphic type. If the exception object contains the requested value, err will point to it; otherwise a null pointer is returned.

@@ -75,28 +73,25 @@ file_read( FILE * f, void * buffer, size_t size ) }

How can the file_read function pass a file name to the exception type constructor? All it has is a FILE handle.

Using boost::exception allows us to free the file_read function from the burden of storing the file name in exceptions it throws:

-
#include <boost/exception.hpp>
+
#include <boost/exception/all.hpp>
+#include <boost/shared_ptr.hpp>
 #include <stdio.h>
 #include <errno.h>
 
-typedef boost::error_info<struct tag_errno,int> errno_info;
-
-class file_read_error: public boost::exception { };
+struct file_read_error: virtual boost::exception { };
 
 void
 file_read( FILE * f, void * buffer, size_t size )
     {
     if( size!=fread(buffer,1,size,f) )
-        throw file_read_error() << errno_info(errno);
+        throw file_read_error() << boost::errinfo_errno(errno);
     }

If file_read detects a failure, it throws an exception which contains the information that is available at the time, namely the errno. Other relevant information, such as the file name, can be added in a context higher up the call stack, where it is known naturally:

-
#include <boost/exception.hpp>
+
#include <boost/exception/all.hpp>
 #include <boost/shared_ptr.hpp>
 #include <stdio.h>
 #include <string>
 
-typedef boost::error_info<struct tag_file_name,std::string> file_name_info;
-
 boost::shared_ptr<FILE> file_open( char const * file_name, char const * mode );
 void file_read( FILE * f, void * buffer, size_t size );
 
@@ -113,7 +108,7 @@ parse_file( char const * file_name )
     catch(
     boost::exception & e )
         {
-        e << file_name_info(file_name);
+        e << boost::errinfo_file_name(file_name);
         throw;
         }
     }
@@ -122,17 +117,17 @@ parse_file( char const * file_name )

The code snippet below demonstrates how boost::tuple can be used to bundle the name of the function that failed, together with the reported errno so that they can be added to exception objects more conveniently together:

#include <boost/exception/info_tuple.hpp>
+#include <boost/exception/errinfo_file_name.hpp>
+#include <boost/exception/errinfo_api_function.hpp>
+#include <boost/exception/errinfo_errno.hpp>
 #include <boost/shared_ptr.hpp>
 #include <stdio.h>
 #include <string>
 #include <errno.h>
 
-typedef boost::error_info<struct tag_file_name,std::string> file_name_info;
-typedef boost::error_info<struct tag_function,char const *> function_info;
-typedef boost::error_info<struct tag_errno,int> errno_info;
-typedef boost::tuple<function_info,errno_info> clib_failure;
+typedef boost::tuple<boost::errinfo_api_function,boost::errinfo_errno> clib_failure;
 
-class file_open_error: public boost::exception { };
+struct file_open_error: virtual boost::exception { };
 
 boost::shared_ptr<FILE>
 file_open( char const * name, char const * mode )
@@ -141,7 +136,7 @@ file_open( char const * name, char const * mode )
         return boost::shared_ptr<FILE>(f,fclose);
     else
         throw file_open_error() <<
-            file_name_info(name) <<
+            boost::errinfo_file_name(name) <<
             clib_failure("fopen",errno);
     }

Note that the members of a boost::tuple are stored separately in exception objects; they can only be retrieved individually, using get_error_info.

diff --git a/doc/types.html b/doc/types.html index 9505d28..630fa32 100644 --- a/doc/types.html +++ b/doc/types.html @@ -22,6 +22,13 @@

Types

e

+

errinfo_api_function

+

errinfo_at_line

+

errinfo_errno

+

errinfo_file_handle

+

errinfo_file_name

+

errinfo_file_open_mode

+

errinfo_type_info_name

error_info

error_info::value_type

exception

diff --git a/example/Jamfile b/example/Jamfile index 244fefe..44e18bf 100644 --- a/example/Jamfile +++ b/example/Jamfile @@ -13,3 +13,4 @@ obj cloning_2 : cloning_2.cpp : multi ; obj info_tuple : info_tuple.cpp ; obj enable_error_info : enable_error_info.cpp ; obj logging : logging.cpp ; +obj errinfos : errinfos.cpp ; diff --git a/example/cloning_1.cpp b/example/cloning_1.cpp index 4e23a62..3e306f8 100644 --- a/example/cloning_1.cpp +++ b/example/cloning_1.cpp @@ -6,17 +6,16 @@ //This example shows how to enable cloning when throwing a boost::exception. #include +#include #include #include -typedef boost::error_info errno_info; - -class file_read_error: public boost::exception { }; +struct file_read_error: virtual boost::exception { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) throw boost::enable_current_exception(file_read_error()) << - errno_info(errno); + boost::errinfo_errno(errno); } diff --git a/example/enable_error_info.cpp b/example/enable_error_info.cpp index 47adb61..5f9a691 100644 --- a/example/enable_error_info.cpp +++ b/example/enable_error_info.cpp @@ -7,7 +7,7 @@ //transporting of arbitrary data to the catch site, even for types //that do not derive from boost::exception. -#include +#include #include typedef boost::error_info std_range_min; diff --git a/example/errinfos.cpp b/example/errinfos.cpp new file mode 100644 index 0000000..ed9a434 --- /dev/null +++ b/example/errinfos.cpp @@ -0,0 +1,53 @@ +//Copyright (c) 2006-2009 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) + +//This example demonstrates the intended use of various commonly used +//error_info typedefs provided by Boost Exception. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +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 +open_file( char const * file, char const * mode ) + { + if( FILE * f=fopen(file,mode) ) + return boost::shared_ptr(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 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; + } diff --git a/example/error_info_1.cpp b/example/error_info_1.cpp index 1b433cf..05339e9 100644 --- a/example/error_info_1.cpp +++ b/example/error_info_1.cpp @@ -6,18 +6,17 @@ //This example shows how to add data to boost::exception objects at the //point of the throw, and how to retrieve that data at the point of the catch. -#include -#include +#include #include -typedef boost::error_info errno_info; //(1) +typedef boost::error_info my_info; //(1) -class my_error: public boost::exception, public std::exception { }; //(2) +struct my_error: virtual boost::exception, virtual std::exception { }; //(2) void f() { - throw my_error() << errno_info(errno); //(3) + throw my_error() << my_info(42); //(3) } void @@ -30,7 +29,7 @@ g() catch( my_error & x ) { - if( int const * err=boost::get_error_info(x) ) - std::cerr << "Error code: " << *err; + if( int const * mi=boost::get_error_info(x) ) + std::cerr << "My info: " << *mi; } } diff --git a/example/error_info_2.cpp b/example/error_info_2.cpp index 3234256..c950574 100644 --- a/example/error_info_2.cpp +++ b/example/error_info_2.cpp @@ -5,28 +5,24 @@ //This example shows how to add arbitrary data to active exception objects. -#include +#include #include #include #include // -typedef boost::error_info errno_info; - -class file_read_error: public boost::exception { }; +struct file_read_error: virtual boost::exception { }; void file_read( FILE * f, void * buffer, size_t size ) { if( size!=fread(buffer,1,size,f) ) - throw file_read_error() << errno_info(errno); + throw file_read_error() << boost::errinfo_errno(errno); } // -typedef boost::error_info file_name_info; - boost::shared_ptr file_open( char const * file_name, char const * mode ); void file_read( FILE * f, void * buffer, size_t size ); @@ -43,7 +39,7 @@ parse_file( char const * file_name ) catch( boost::exception & e ) { - e << file_name_info(file_name); + e << boost::errinfo_file_name(file_name); throw; } } diff --git a/example/example_io.cpp b/example/example_io.cpp index 3befc46..59b9848 100644 --- a/example/example_io.cpp +++ b/example/example_io.cpp @@ -3,48 +3,34 @@ //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) -//This program simulates errors on copying simple data files. -//It demonstrates how the proposed Boost exception library can be used. -// -//The documentation for boost::exception can be found at: -// -// http://www.revergestudios.com/boost-exception/boost-exception.htm. -// -//The output from this program can vary depending on the compiler/OS combination. +//This program simulates errors on copying simple data files. It demonstrates +//typical Boost Exception usage. -#include +//The output from this program can vary depending on the platform. + +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include -#include #include -#include -typedef boost::error_info errno_info; -typedef boost::error_info > file_stream_info; -typedef boost::error_info open_mode_info; //The open mode of a failed fopen request. -typedef boost::error_info file_name_info; //The file name of a failed file operation. -typedef boost::error_info file_name_src_info; //The source file name of a failed copy operation. -typedef boost::error_info file_name_dst_info; //The destination file name of a failed copy operation. -typedef boost::error_info function_info; //The name of the C function which reported the failure. - -std::string -to_string( errno_info const & e ) - { - int en=e.value(); - std::ostringstream s; - s << en << ", OS says \"" << strerror(en) << "\""; - return s.str(); - } +typedef boost::error_info errinfo_src_file_name; +typedef boost::error_info errinfo_dst_file_name; char const data[] = "example"; size_t const data_size = sizeof(data); class error: //Base for all exception objects we throw. - public std::exception, - public boost::exception + public virtual std::exception, + public virtual boost::exception { public: @@ -61,14 +47,12 @@ error: //Base for all exception objects we throw. } }; -class open_error: public error { }; -class read_error: public error { }; -class write_error: public error { }; - -class fopen_error: public open_error { }; -class fread_error: public read_error { }; -class fwrite_error: public write_error { }; - +struct open_error: virtual error { }; +struct read_error: virtual error { }; +struct write_error: virtual error { }; +struct fopen_error: virtual open_error { }; +struct fread_error: virtual read_error { }; +struct fwrite_error: virtual write_error { }; boost::shared_ptr my_fopen( char const * name, char const * mode ) @@ -77,10 +61,10 @@ my_fopen( char const * name, char const * mode ) return boost::shared_ptr(f,fclose); else BOOST_THROW_EXCEPTION(fopen_error() << - errno_info(errno) << - file_name_info(name) << - open_mode_info(mode) << - function_info("fopen")); + boost::errinfo_errno (errno) << + boost::errinfo_file_name(name) << + boost::errinfo_file_open_mode(mode) << + boost::errinfo_api_function("fopen")); } void @@ -89,9 +73,9 @@ my_fread( void * buffer, size_t size, size_t count, boost::shared_ptr cons assert(stream); if( count!=fread(buffer,size,count,stream.get()) || ferror(stream.get()) ) BOOST_THROW_EXCEPTION(fread_error() << - function_info("fread") << - errno_info(errno) << - file_stream_info(boost::weak_ptr(stream))); + boost::errinfo_api_function("fread") << + boost::errinfo_errno(errno) << + boost::errinfo_file_handle(boost::weak_ptr(stream))); } void @@ -100,9 +84,9 @@ my_fwrite( void const * buffer, size_t size, size_t count, boost::shared_ptr(stream))); + boost::errinfo_api_function("fwrite") << + boost::errinfo_errno(errno) << + boost::errinfo_file_handle(boost::weak_ptr(stream))); } void @@ -132,17 +116,17 @@ copy_data( char const * src_file_name, char const * dst_file_name ) catch( boost::exception & x ) { - if( boost::weak_ptr const * f=boost::get_error_info(x) ) + if( boost::weak_ptr const * f=boost::get_error_info(x) ) if( boost::shared_ptr fs = f->lock() ) { if( fs==src ) - x << file_name_info(src_file_name); + x << boost::errinfo_file_name(src_file_name); else if( fs==dst ) - x << file_name_info(dst_file_name); + x << boost::errinfo_file_name(dst_file_name); } x << - file_name_src_info(src_file_name) << - file_name_dst_info(dst_file_name); + errinfo_src_file_name(src_file_name) << + errinfo_dst_file_name(dst_file_name); throw; } } @@ -150,25 +134,25 @@ copy_data( char const * src_file_name, char const * dst_file_name ) void dump_copy_info( boost::exception const & x ) { - if( std::string const * src = boost::get_error_info(x) ) + if( std::string const * src = boost::get_error_info(x) ) std::cerr << "Source file name: " << *src << "\n"; - if( std::string const * dst = boost::get_error_info(x) ) + if( std::string const * dst = boost::get_error_info(x) ) std::cerr << "Destination file name: " << *dst << "\n"; } void dump_file_info( boost::exception const & x ) { - if( std::string const * fn = boost::get_error_info(x) ) + if( std::string const * fn = boost::get_error_info(x) ) std::cerr << "File name: " << *fn << "\n"; } void dump_clib_info( boost::exception const & x ) { - if( int const * err=boost::get_error_info(x) ) + if( int const * err=boost::get_error_info(x) ) std::cerr << "OS error: " << *err << "\n"; - if( std::string const * fn=boost::get_error_info(x) ) + if( char const * const * fn=boost::get_error_info(x) ) std::cerr << "Failed function: " << *fn << "\n"; } diff --git a/example/info_tuple.cpp b/example/info_tuple.cpp index de19c44..d05965d 100644 --- a/example/info_tuple.cpp +++ b/example/info_tuple.cpp @@ -3,21 +3,21 @@ //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) -//This example shows how boost::error_info_group can be used to bundle -//the name of the function that fails together with the reported errno. +//This example shows how boost::tuple can be used to bundle the +//name of the function that fails together with the reported errno. #include +#include +#include +#include #include #include #include #include -typedef boost::error_info file_name_info; -typedef boost::error_info function_info; -typedef boost::error_info errno_info; -typedef boost::tuple clib_failure; +typedef boost::tuple clib_failure; -class file_open_error: public boost::exception { }; +struct file_open_error: virtual boost::exception { }; boost::shared_ptr file_open( char const * name, char const * mode ) @@ -26,6 +26,6 @@ file_open( char const * name, char const * mode ) return boost::shared_ptr(f,fclose); else throw file_open_error() << - file_name_info(name) << + boost::errinfo_file_name(name) << clib_failure("fopen",errno); } diff --git a/example/logging.cpp b/example/logging.cpp index 11e6401..c1b51e7 100644 --- a/example/logging.cpp +++ b/example/logging.cpp @@ -3,9 +3,9 @@ //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) -//This example shows to print all data contained in a boost::exception. +//This example shows how to print all data contained in a boost::exception. -#include +#include #include void f(); //throws unknown types that derive from boost::exception. diff --git a/include/boost/exception/all.hpp b/include/boost/exception/all.hpp new file mode 100644 index 0000000..c5c677e --- /dev/null +++ b/include/boost/exception/all.hpp @@ -0,0 +1,26 @@ +//Copyright (c) 2006-2008 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) + +#ifndef UUID_316FDA946C0D11DEA9CBAE5255D89593 +#define UUID_316FDA946C0D11DEA9CBAE5255D89593 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef BOOST_NO_EXCEPTIONS +#include +#endif + +#endif diff --git a/include/boost/exception/errinfo_api_function.hpp b/include/boost/exception/errinfo_api_function.hpp new file mode 100644 index 0000000..481c613 --- /dev/null +++ b/include/boost/exception/errinfo_api_function.hpp @@ -0,0 +1,22 @@ +//Copyright (c) 2006-2009 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) + +#ifndef UUID_DDFBB4546C1211DEA4659E9055D89593 +#define UUID_DDFBB4546C1211DEA4659E9055D89593 + +#include "boost/exception/error_info.hpp" + +namespace +boost + { + //Usage hint: + //if( api_function(....)!=0 ) + // BOOST_THROW_EXCEPTION( + // failure() << + // errinfo_api_function("api_function") ); + typedef error_info errinfo_api_function; + } + +#endif diff --git a/include/boost/exception/errinfo_at_line.hpp b/include/boost/exception/errinfo_at_line.hpp new file mode 100644 index 0000000..cbd5cce --- /dev/null +++ b/include/boost/exception/errinfo_at_line.hpp @@ -0,0 +1,18 @@ +//Copyright (c) 2006-2009 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) + +#ifndef UUID_E7255CE26C1211DE85800C9155D89593 +#define UUID_E7255CE26C1211DE85800C9155D89593 + +namespace +boost + { + template class error_info; + + //Use with parsing errors exceptions, for example in a XML file parser. + typedef error_info errinfo_at_line; + } + +#endif diff --git a/include/boost/exception/errinfo_errno.hpp b/include/boost/exception/errinfo_errno.hpp new file mode 100644 index 0000000..310ceb7 --- /dev/null +++ b/include/boost/exception/errinfo_errno.hpp @@ -0,0 +1,35 @@ +//Copyright (c) 2006-2009 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) + +#ifndef UUID_F0EE17BE6C1211DE87FF459155D89593 +#define UUID_F0EE17BE6C1211DE87FF459155D89593 + +#include "boost/exception/info.hpp" +#include +#include + +namespace +boost + { + typedef error_info errinfo_errno; + + //Usage hint: + //if( c_function(....)!=0 ) + // BOOST_THROW_EXCEPTION( + // failure() << + // errinfo_errno(errno) << + // errinfo_api_function("c_function") ); + inline + std::string + to_string( errinfo_errno const & e ) + { + std::ostringstream tmp; + int v=e.value(); + tmp << v << ", \"" << strerror(v) << "\""; + return tmp.str(); + } + } + +#endif diff --git a/include/boost/exception/errinfo_file_handle.hpp b/include/boost/exception/errinfo_file_handle.hpp new file mode 100644 index 0000000..8e6cff8 --- /dev/null +++ b/include/boost/exception/errinfo_file_handle.hpp @@ -0,0 +1,20 @@ +//Copyright (c) 2006-2009 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) + +#ifndef UUID_F79E6EE26C1211DEB26E929155D89593 +#define UUID_F79E6EE26C1211DEB26E929155D89593 + +#include + +namespace +boost + { + template class weak_ptr; + template class error_info; + + typedef error_info > errinfo_file_handle; + } + +#endif diff --git a/include/boost/exception/errinfo_file_name.hpp b/include/boost/exception/errinfo_file_name.hpp new file mode 100644 index 0000000..d3cce4d --- /dev/null +++ b/include/boost/exception/errinfo_file_name.hpp @@ -0,0 +1,26 @@ +//Copyright (c) 2006-2009 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) + +#ifndef UUID_FEE5120A6C1211DE94E8BC9155D89593 +#define UUID_FEE5120A6C1211DE94E8BC9155D89593 + +#include + +namespace +boost + { + template class error_info; + + //Usage hint: + //FILE * f=fopen(name,mode); + //if( !f ) + // BOOST_THROW_EXCEPTION( + // file_open_error() << + // errinfo_file_name(name) << + // errinfo_file_open_mode(mode) ); + typedef error_info errinfo_file_name; + } + +#endif diff --git a/include/boost/exception/errinfo_file_open_mode.hpp b/include/boost/exception/errinfo_file_open_mode.hpp new file mode 100644 index 0000000..f4fba0d --- /dev/null +++ b/include/boost/exception/errinfo_file_open_mode.hpp @@ -0,0 +1,26 @@ +//Copyright (c) 2006-2009 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) + +#ifndef UUID_056F1F266C1311DE8E74299255D89593 +#define UUID_056F1F266C1311DE8E74299255D89593 + +#include + +namespace +boost + { + template class error_info; + + //Usage hint: + //FILE * f=fopen(name,mode); + //if( !f ) + // BOOST_THROW_EXCEPTION( + // file_open_error() << + // errinfo_file_name(name) << + // errinfo_file_open_mode(mode) ); + typedef error_info errinfo_file_open_mode; + } + +#endif diff --git a/include/boost/exception/errinfo_type_info_name.hpp b/include/boost/exception/errinfo_type_info_name.hpp new file mode 100644 index 0000000..0b060e2 --- /dev/null +++ b/include/boost/exception/errinfo_type_info_name.hpp @@ -0,0 +1,23 @@ +//Copyright (c) 2006-2009 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) + +#ifndef UUID_0E11109E6C1311DEB7EA649255D89593 +#define UUID_0E11109E6C1311DEB7EA649255D89593 + +#include + +namespace +boost + { + template class error_info; + + //Usage hint: + //BOOST_THROW_EXCEPTION( + // bad_type() << + // errinfo_type_info_name(typeid(x).name()) ); + typedef error_info errinfo_type_info_name; + } + +#endif diff --git a/include/boost/exception/exception.hpp b/include/boost/exception/exception.hpp index 6df93ac..6233f19 100644 --- a/include/boost/exception/exception.hpp +++ b/include/boost/exception/exception.hpp @@ -80,13 +80,13 @@ boost template class error_info; - typedef error_info throw_function; - typedef error_info throw_file; - typedef error_info throw_line; + typedef error_info throw_function; + typedef error_info throw_file; + typedef error_info throw_line; template <> class - error_info + error_info { public: typedef char const * value_type; @@ -100,7 +100,7 @@ boost template <> class - error_info + error_info { public: typedef char const * value_type; @@ -114,7 +114,7 @@ boost template <> class - error_info + error_info { public: typedef int value_type; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 894a916..23d38e7 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -35,6 +35,7 @@ run diagnostic_information_test.cpp ; run refcount_ptr_test.cpp ; run current_exception_cast_test.cpp ; run no_exceptions_test.cpp : : : off ; +run errinfos_test.cpp ; compile-fail exception_fail.cpp ; compile-fail throw_exception_fail.cpp ; @@ -49,4 +50,12 @@ compile info_hpp_test.cpp ; compile info_tuple_hpp_test.cpp ; compile to_string_hpp_test.cpp ; compile to_string_stub_hpp_test.cpp ; +compile all_hpp_test.cpp ; compile current_exception_cast_hpp_test.cpp ; +compile errinfo_api_function_hpp_test.cpp ; +compile errinfo_at_line_hpp_test.cpp ; +compile errinfo_errno_hpp_test.cpp ; +compile errinfo_file_handle_hpp_test.cpp ; +compile errinfo_file_name_hpp_test.cpp ; +compile errinfo_file_open_mode_hpp_test.cpp ; +compile errinfo_type_info_name_hpp_test.cpp ; diff --git a/test/all_hpp_test.cpp b/test/all_hpp_test.cpp new file mode 100644 index 0000000..0e3fe58 --- /dev/null +++ b/test/all_hpp_test.cpp @@ -0,0 +1,7 @@ +//Copyright (c) 2006-2009 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) + +#include +#include diff --git a/test/errinfo_api_function_hpp_test.cpp b/test/errinfo_api_function_hpp_test.cpp new file mode 100644 index 0000000..fcb9234 --- /dev/null +++ b/test/errinfo_api_function_hpp_test.cpp @@ -0,0 +1,7 @@ +//Copyright (c) 2006-2009 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) + +#include +#include diff --git a/test/errinfo_at_line_hpp_test.cpp b/test/errinfo_at_line_hpp_test.cpp new file mode 100644 index 0000000..cf13e30 --- /dev/null +++ b/test/errinfo_at_line_hpp_test.cpp @@ -0,0 +1,7 @@ +//Copyright (c) 2006-2009 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) + +#include +#include diff --git a/test/errinfo_errno_hpp_test.cpp b/test/errinfo_errno_hpp_test.cpp new file mode 100644 index 0000000..6bd627e --- /dev/null +++ b/test/errinfo_errno_hpp_test.cpp @@ -0,0 +1,7 @@ +//Copyright (c) 2006-2009 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) + +#include +#include diff --git a/test/errinfo_file_handle_hpp_test.cpp b/test/errinfo_file_handle_hpp_test.cpp new file mode 100644 index 0000000..8419749 --- /dev/null +++ b/test/errinfo_file_handle_hpp_test.cpp @@ -0,0 +1,7 @@ +//Copyright (c) 2006-2009 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) + +#include +#include diff --git a/test/errinfo_file_name_hpp_test.cpp b/test/errinfo_file_name_hpp_test.cpp new file mode 100644 index 0000000..2018d6b --- /dev/null +++ b/test/errinfo_file_name_hpp_test.cpp @@ -0,0 +1,7 @@ +//Copyright (c) 2006-2009 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) + +#include +#include diff --git a/test/errinfo_file_open_mode_hpp_test.cpp b/test/errinfo_file_open_mode_hpp_test.cpp new file mode 100644 index 0000000..4d6ebd3 --- /dev/null +++ b/test/errinfo_file_open_mode_hpp_test.cpp @@ -0,0 +1,7 @@ +//Copyright (c) 2006-2009 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) + +#include +#include diff --git a/test/errinfo_type_info_name_hpp_test.cpp b/test/errinfo_type_info_name_hpp_test.cpp new file mode 100644 index 0000000..20888ef --- /dev/null +++ b/test/errinfo_type_info_name_hpp_test.cpp @@ -0,0 +1,7 @@ +//Copyright (c) 2006-2009 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) + +#include +#include diff --git a/test/errinfos_test.cpp b/test/errinfos_test.cpp new file mode 100644 index 0000000..3e8aa19 --- /dev/null +++ b/test/errinfos_test.cpp @@ -0,0 +1,61 @@ +//Copyright (c) 2006-2009 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) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct +test_exception: + virtual boost::exception, + virtual std::exception + { + }; + +int +main() + { + using namespace boost; + try + { + BOOST_THROW_EXCEPTION( + test_exception() << + errinfo_api_function("failed_api_function") << + errinfo_at_line(42) << + errinfo_errno(errno) << + errinfo_file_handle(weak_ptr()) << + errinfo_file_name("filename.txt") << + errinfo_file_open_mode("rb") << + errinfo_type_info_name(typeid(int).name()) ); + BOOST_TEST(false); + } + catch( + boost::exception & e ) + { + BOOST_TEST(get_error_info(e) && *get_error_info(e)==std::string("failed_api_function")); + BOOST_TEST(get_error_info(e) && *get_error_info(e)==42); + BOOST_TEST(get_error_info(e) && *get_error_info(e)==0); + BOOST_TEST(get_error_info(e) && get_error_info(e)->expired()); + BOOST_TEST(get_error_info(e) && *get_error_info(e)=="filename.txt"); + BOOST_TEST(get_error_info(e) && *get_error_info(e)=="rb"); + BOOST_TEST(get_error_info(e) && *get_error_info(e)==typeid(int).name()); + } + catch( + ... ) + { + BOOST_TEST(false); + } + return boost::report_errors(); + }