diff --git a/doc/BOOST_ERROR_INFO.html b/doc/BOOST_ERROR_INFO.html deleted file mode 100644 index 699e8bc..0000000 --- a/doc/BOOST_ERROR_INFO.html +++ /dev/null @@ -1,61 +0,0 @@ - - -
- -#include <boost/exception/info.hpp>
-namespace
-boost
- {
- 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;
-
- #define BOOST_ERROR_INFO\
- ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\
- ::boost::throw_file(__FILE__) <<\
- ::boost::throw_line((int)__LINE__)
- }
-This macro is designed to be used with operator<< when throwing a boost::exception, to store information about the location of the throw statement. It can be chained with other error_infos in a single throw expression.
-#include <boost/throw_exception.hpp>
+#if !defined( BOOST_NO_EXCEPTIONS ) && !defined( BOOST_EXCEPTION_DISABLE )
+ #include <boost/exception/exception.hpp>
+ #include <boost/current_function.hpp>
+ #define BOOST_THROW_EXCEPTION(x)\
+ ::boost::throw_exception( ::boost::enable_error_info(x) <<\
+ ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\
+ ::boost::throw_file(__FILE__) <<\
+ ::boost::throw_line((int)__LINE__) )
+#else
+ #define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)
+#endif
- #ifdef BOOST_NO_EXCEPTIONS
-
+#ifdef BOOST_NO_EXCEPTIONS
void throw_exception( std::exception const & e ); // user defined
-
- #else
-
+#else
template <class E>
void throw_exception( E const & e );
-
- #endif
- }
+#endif
Frees all resources associated with a boost::exception object.
Nothing.
-virtual char const * diagnostic_information() const throw();
-A string representation of all data stored in the boost::exception object by the operator<< function. See "Diagnostic Information" for details.
-Nothing.
-Nothing.
-#include <boost/exception/info.hpp>
-namespace
-boost
- {
- 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;
-
- #define BOOST_ERROR_INFO\
- ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\
- ::boost::throw_file(__FILE__) <<\
- ::boost::throw_line((int)__LINE__)
- }
-This macro is designed to be used with operator<< when throwing a boost::exception, to store information about the location of the throw statement. It can be chained with other error_infos in a single throw expression.
#include <boost/exception/diagnostic_information.hpp>
+#include <boost/exception/diagnostic_information.hpp>
namespace boost { - template <class T> - std::string diagnostic_information( T const & x ); + std::string diagnostic_information( boost::exception const & x ); }
Platform-specific diagnostic information about x.
+This function iterates over all data objects stored in the boost::exception through operator<<. The returned string is constructed by converting each data object to string and then concatenating these strings together.
+When the error_info<Tag,T> template is instantiated, the system attempts overload resolution for an unqualified call to to_string(x), where x is of type T. If this is successful, the to_string overload is expected to return std::string and is used to convert objects of type T to string.
+Otherwise, the system attempts overload resolution for s << x, where s is a std::ostringstream and x is of type T. If this is successful, the operator<< overload is used to convert objects of type T to string.
+Otherwise the system is unable to convert objects of type T to string, and an unspecified stub string value is used without issuing a compile error.
#include <exception> +#include <string> namespace boost { - template <class T> - std::string diagnostic_information( T const & x ); + class exception; + std::string diagnostic_information( boost::exception const & x ); }
#include <boost/exception/diagnostic_information.hpp>
+#include <boost/exception/diagnostic_information.hpp>
namespace boost { - template <class T> - std::string diagnostic_information( T const & x ); + std::string diagnostic_information( boost::exception const & x ); }
Platform-specific diagnostic information about x.
+This function iterates over all data objects stored in the boost::exception through operator<<. The returned string is constructed by converting each data object to string and then concatenating these strings together.
+When the error_info<Tag,T> template is instantiated, the system attempts overload resolution for an unqualified call to to_string(x), where x is of type T. If this is successful, the to_string overload is expected to return std::string and is used to convert objects of type T to string.
+Otherwise, the system attempts overload resolution for s << x, where s is a std::ostringstream and x is of type T. If this is successful, the operator<< overload is used to convert objects of type T to string.
+Otherwise the system is unable to convert objects of type T to string, and an unspecified stub string value is used without issuing a compile error.
Nothing.
Of course, to actually add an error_info object to exceptions using operator<<, or to retrieve it using get_error_info, you must first #include <boost/exception/info.hpp>.
Frees all resources associated with a boost::exception object.
Nothing.
-virtual char const * diagnostic_information() const throw();
-A string representation of all data stored in the boost::exception object by the operator<< function. See "Diagnostic Information" for details.
-Nothing.
-virtual char const * diagnostic_information() const throw();
-A string representation of all data stored in the boost::exception object by the operator<< function. See "Diagnostic Information" for details.
-Nothing.
-Nothing.
exception::diagnostic_information
diff --git a/doc/operator_shl_exception.html b/doc/operator_shl_exception.html index f7801a4..307f1ad 100644 --- a/doc/operator_shl_exception.html +++ b/doc/operator_shl_exception.html @@ -38,13 +38,12 @@ booststd::bad_alloc, or any exception emitted by the T copy constructor.
#include <boost/exception/exception.hpp> -#include <exception> +#if !defined( BOOST_NO_EXCEPTIONS ) && !defined( BOOST_EXCEPTION_DISABLE ) + #include <boost/exception/exception.hpp> + #include <boost/current_function.hpp> + #define BOOST_THROW_EXCEPTION(x)\ + ::boost::throw_exception( ::boost::enable_error_info(x) <<\ + ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\ + ::boost::throw_file(__FILE__) <<\ + ::boost::throw_line((int)__LINE__) ) +#else + #define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x) +#endif -namespace -boost - { - #ifdef BOOST_NO_EXCEPTIONS - +#ifdef BOOST_NO_EXCEPTIONS void throw_exception( std::exception const & e ); // user defined - - #else - +#else template <class E> void throw_exception( E const & e ); - - #endif - }-+#endif +
Class boost::exception provides a virtual member function diagnostic_information, with a signature similar to the familiar std::exception::what function. The default implementation returns a string value that 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:
+Boost Exception provides a namespace-scope function diagnostic_information which takes a boost::exception. The returned string contains:
+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 <iostream> @@ -37,17 +42,12 @@ g() catch( boost::exception & e ) { - std::cerr << e.diagnostic_information(); + std::cerr << diagnostic_information(e); } }-
The diagnostic_information member function iterates over all data objects stored in the boost::exception through operator<<. The returned string is constructed by converting each data object to string and then concatenating these strings together.
-When the error_info<Tag,T> template is instantiated, the system attempts overload resolution for an unqualified call to to_string(x), where x is of type T. If this is successful, the to_string overload is expected to return std::string and is used to convert objects of type T to string.
-Otherwise, the system attempts overload resolution for s << x, where s is a std::ostringstream and x is of type T. If this is successful, the operator<< overload is used to convert objects of type T to string.
-Otherwise the system is unable to convert objects of type T to string, and an unspecified stub string value is used without issuing a compile error.