Custom payloads

So far in this tutorial, type EC in result<T, EC> has always been a std::error_code or boost::system::error_code. With NoValuePolicy set to default_policy<T, EC, EP> , EC needs in fact to merely satisfy the trait is_error_code_available<T> for EC to be treated as if an error_code. Outcome specialises that trait for std::error_code and boost::system::error_code, hence they “just work”. If no specialisation exists, trait::is_error_code_available<EC> is true if there exists some ADL discovered free function make_error_code(EC). »