Update documentation

This commit is contained in:
Peter Dimov
2022-02-17 01:23:30 +02:00
parent 26f3ce3c5c
commit 68d092f4d7
3 changed files with 18 additions and 16 deletions
+10 -13
View File
@@ -59,7 +59,7 @@ logical throw point, instead of always pointing into the helper.
----
#include <boost/throw_exception.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <boost/core/verbose_terminate_handler.hpp>
#include <stdexcept>
#include <cstddef>
#include <iostream>
@@ -93,24 +93,21 @@ void f2( std::size_t i, std::size_t n )
int main()
{
try
{
f1( 0, 3 );
f2( 4, 3 );
}
catch( std::exception const & x )
{
std::cerr << boost::diagnostic_information( x ) << std::endl;
}
std::set_terminate( boost::core::verbose_terminate_handler );
f1( 0, 3 );
f2( 4, 3 );
}
----
Sample output:
```none
example.cpp(31): Throw in function void f2(std::size_t, std::size_t)
Dynamic exception type: boost::wrapexcept<std::out_of_range>
std::exception::what: Index out of range: 4 >= 3
std::terminate called after throwing an exception:
type: boost::wrapexcept<std::out_of_range>
what(): Index out of range: 4 >= 3
location: <source>:31:34 in function 'f2'
```
## Using boost::throw_with_location