Closed skorokhod closed 2 years ago
Thanks, I'll take a look.
Good idea. Actually, AutoSAR Adaptive, which is a standard in automotive industry, adopts the same idea. Specification of Core Types for Adaptive Platform.pdf is a very good reference. Chapter 7.1 is the error handling philosophy, and 8.3 describes the specification of Result.
And, _AUTOSAR_EXPAdaptivePlatformInterfacesGuidelines.pdf Chapter 2.1 well explains detail/usage.
Hope my comment is helpful.
It sounds like a specialisation of the functionality of an etl::variant
.
I've just looked at the ara::core::Result
class file on Github and it is based on a variant.
will it allow to use like Result<void, Error> or Result<int, int>?
Yes, it would.
20.17.0
Added etl::result
Thanks for the Great Library! What do you think about adding some Rust-like 'result' container (https://doc.rust-lang.org/std/result/) which can hold one of two value types. It's very convenient to use for functions which should return value or error-code. Moreover it can be integrated with optional-type to extract the result