Reduce stack usage in error::eval, fix inspect
The previous implementation in error::eval put an error to the stack and then optionally calling the next function object. As a result, all errors remained on the stack until unrolling the stack eventually. By putting the error into an if-block, temporary objects now go out-of-scope before calling the next function object. Also, the previous implementation of `inspect` did not work properly for any visitor not producing an error as result. The new implementation is generic and also avoids using std::function to reduce heap allocations.
Showing
Please register or sign in to comment