You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/leaf.adoc
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -401,7 +401,7 @@ leaf::result<U> r = leaf::try_handle_some(
401
401
Once again, error handlers are considered in order:
402
402
403
403
* 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;
404
-
* otherwise, the second error handler will be used if an error object of type `io_error` is avaliable;
404
+
* otherwise, the second error handler will be used if an error object of type `io_error` is available;
405
405
* otherwise, `leaf_try_handle_some` fails.
406
406
407
407
An alternative way to write the above is to provide a single error handler that takes the `e_file_name` argument as a pointer:
@@ -3161,7 +3161,7 @@ The `throw_exception` function is overloaded: it can be invoked with no argument
3161
3161
** its `std::exception` subobject is default-initialized;
3162
3162
** its `error_id` subobject is initialized by `<<new_error>>(std::forward<E1>(e1), std::forward<E>(e)...`).
3163
3163
3164
-
<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:
3164
+
<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:
3165
3165
** its `std::exception` subobject is default-initialized;
3166
3166
** its `error_id` subobject is initialized by `<<new_error>>()`.
These functions have the usual semantics, comparing `a.value()` and `b.value()`.
4027
4027
4028
-
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`.
4028
+
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`.
4029
4029
4030
4030
'''
4031
4031
@@ -4723,7 +4723,7 @@ Effects:
4723
4723
[[result::value_type]]
4724
4724
==== `value_type`
4725
4725
4726
-
A member type of `result<T>`, defined as a synonim for `T`.
4726
+
A member type of `result<T>`, defined as a synonym for `T`.
Copy file name to clipboardExpand all lines: doc/whitepaper.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -241,7 +241,7 @@ The above function computes a `float` value based on the contents of the specifi
241
241
242
242
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*).
243
243
244
-
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).
244
+
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).
245
245
246
246
### 6.2. C++ Exceptions
247
247
@@ -357,7 +357,7 @@ Using LEAF, *error handling* functions match error objects similarly to the way
357
357
* Each handler can specify multiple objects to be matched by type, rather than only one.
358
358
* 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.
359
359
360
-
Whithout exception handling, this is achieved using the following syntax:
360
+
Without exception handling, this is achieved using the following syntax:
Copy file name to clipboardExpand all lines: example/print_file/readme.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Print File Example
2
2
3
-
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.
3
+
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.
4
4
5
5
*[print_file_leaf_result.cpp](./print_file_leaf_result.cpp) reports errors with
6
6
`leaf::result<T>`, using an error code `enum` for classification of failures.
Copy file name to clipboardExpand all lines: example/readme.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Example Programs Using LEAF to Handle Errors
2
2
3
-
*[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.
3
+
*[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.
4
4
5
5
*[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.
6
6
*[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.
0 commit comments