3 ms·
Not having exceptions doesn't imply that. An alternative is ErrorOr<ReturnType> returning factory functions. It requires that ReturnType is movable tho (can be
by d1zzy 7y ago
Not having exceptions doesn't imply that. An alternative is ErrorOr<ReturnType> returning factory functions. It requires that ReturnType is movable tho (can be further wrapped in std::unique_ptr if not).
Not every error is exceptional so not every error should use exceptions. This is especially important in lower level code where someone's exception is someone else's expected code path.