Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/leaf.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ leaf::result<U> r = leaf::try_handle_some(
Once again, error handlers are considered in order:

* The first error handler will be used if an error object of type `io_error` _and_ and error_object of type `e_file_name` are available;
* otherwise, the second error handler will be used if an error object of type `io_error` is avaliable;
* otherwise, the second error handler will be used if an error object of type `io_error` is available;
* otherwise, `leaf_try_handle_some` fails.

An alternative way to write the above is to provide a single error handler that takes the `e_file_name` argument as a pointer:
Expand Down Expand Up @@ -3161,7 +3161,7 @@ The `throw_exception` function is overloaded: it can be invoked with no argument
** its `std::exception` subobject is default-initialized;
** its `error_id` subobject is initialized by `<<new_error>>(std::forward<E1>(e1), std::forward<E>(e)...`).

<3> If the fuction is invoked without arguments, the thrown exception is of unspecified type which derives publicly from `std::exception` *and* from class `error_id`, such that:
<3> If the function is invoked without arguments, the thrown exception is of unspecified type which derives publicly from `std::exception` *and* from class `error_id`, such that:
** its `std::exception` subobject is default-initialized;
** its `error_id` subobject is initialized by `<<new_error>>()`.

Expand Down Expand Up @@ -4025,7 +4025,7 @@ namespace boost { namespace leaf {

These functions have the usual semantics, comparing `a.value()` and `b.value()`.

NOTE: The exact strict weak ordering implemented by `operator<` is not specified. In particular, if for two `error_id` objects `a` and `b`, `a < b` is true, it does not follow that the failure identified by `a` ocurred earlier than the one identified by `b`.
NOTE: The exact strict weak ordering implemented by `operator<` is not specified. In particular, if for two `error_id` objects `a` and `b`, `a < b` is true, it does not follow that the failure identified by `a` occurred earlier than the one identified by `b`.

'''

Expand Down Expand Up @@ -4723,7 +4723,7 @@ Effects:
[[result::value_type]]
==== `value_type`

A member type of `result<T>`, defined as a synonim for `T`.
A member type of `result<T>`, defined as a synonym for `T`.

'''

Expand Down
4 changes: 2 additions & 2 deletions doc/whitepaper.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ The above function computes a `float` value based on the contents of the specifi

In case of failure to `open()`, our function stays out of the way: the error code is communicated from `open()` (which sets the `errno`) *directly* to an *error handling* function up the call stack (which examines the `errno` in order to understand the failure), while the return value of each intermediate function needs only communicate a single bit of data (the *failure flag*).

The major drawback of this appoach is that the *failure flag* is not communicated uniformly, which means that *error neutral* functions can't check for errors generically (e.g. each layer needs to know about the different `INVALID_VALUE`s).
The major drawback of this approach is that the *failure flag* is not communicated uniformly, which means that *error neutral* functions can't check for errors generically (e.g. each layer needs to know about the different `INVALID_VALUE`s).

### 6.2. C++ Exceptions

Expand Down Expand Up @@ -357,7 +357,7 @@ Using LEAF, *error handling* functions match error objects similarly to the way
* Each handler can specify multiple objects to be matched by type, rather than only one.
* The error objects are matched dynamically, but solely based on their static type. This allows *all* error objects to be allocated on the stack, using automatic storage duration.

Whithout exception handling, this is achieved using the following syntax:
Without exception handling, this is achieved using the following syntax:

```c++
leaf::handle_all(
Expand Down
2 changes: 1 addition & 1 deletion example/print_file/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Print File Example

This directory contains several versions of a trivial program which takes a file name on the command line and prints it. Each version uses a different error handling implementaiton.
This directory contains several versions of a trivial program which takes a file name on the command line and prints it. Each version uses a different error handling implementation.

* [print_file_leaf_result.cpp](./print_file_leaf_result.cpp) reports errors with
`leaf::result<T>`, using an error code `enum` for classification of failures.
Expand Down
2 changes: 1 addition & 1 deletion example/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Example Programs Using LEAF to Handle Errors

* [print_file](./print_file): This directory contains several versions of a trivial program which takes a file name on the command line and prints it. Each version uses a different error handling implementaiton.
* [print_file](./print_file): This directory contains several versions of a trivial program which takes a file name on the command line and prints it. Each version uses a different error handling implementation.

* [try_capture_all_result.cpp](https://github.com/boostorg/leaf/blob/master/example/try_capture_all_result.cpp?ts=4): Shows how to transport error objects between threads in a `leaf::result<T>` object without using exception handling.
* [try_capture_all_exceptions.cpp](https://github.com/boostorg/leaf/blob/master/example/try_capture_all_exceptions.cpp?ts=4): Shows how to transport error objects between threads in a `leaf::result<T>` object using exception handling.
Expand Down
2 changes: 1 addition & 1 deletion include/boost/leaf/detail/demangle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#if defined(BOOST_LEAF_HAS_CXXABI_H)
# include <cxxabi.h>
// For some archtectures (mips, mips64, x86, x86_64) cxxabi.h in Android NDK is implemented by gabi++ library
// For some architectures (mips, mips64, x86, x86_64) cxxabi.h in Android NDK is implemented by gabi++ library
// (https://android.googlesource.com/platform/ndk/+/master/sources/cxx-stl/gabi++/), which does not implement
// abi::__cxa_demangle(). We detect this implementation by checking the include guard here.
# if defined(__GABIXX_CXXABI_H__)
Expand Down