Boost logo

Boost :

Subject: Re: [boost] [outcome] Some documentation suggestions
From: Vinícius dos Santos Oliveira (vini.ipsmaker_at_[hidden])
Date: 2018-01-24 16:43:04


One more thing:

Documentation around policies is confusing. I don't know when my policy's
function would be called. I only know which Outcome's function will call it.

>From this page[1], I understand that my policy's function will do the check
to see if value is valid.

But another page[2] will tell me that all_narrow's functions will call
_ub() **undiscriminately**. Does it mean that the checks are performed
internally by Outcome and policy's functions are only called conditionally?
If that is the case, documentation for **when** these functions are called
should be provided.

[1] https://ned14.github.io/outcome/tutorial/policies/anatomy/
[2] https://ned14.github.io/outcome/tutorial/policies/builtin/

2018-01-24 12:03 GMT-03:00 Vinícius dos Santos Oliveira <
vini.ipsmaker_at_[hidden]>:

> Maybe I could send some PRs later (I've already sent one a few moments
> ago). But, for now, I'll have to postpone.
>
> Notes:
>
>
> - You put too much focus in "open (error) type hierarchies" (e.g.
> `error_code`). Not a problem. Also, do not change anything just because
> this comment. Really, it is not a problem.
> - The beginning of the documentation gave me the impression that I
> could only use EC types that were convertible to `std::error_code`[1], “it
> need in fact to merely satisfy trait::has_error_code_v<EC>”. Later pages
> corrected my understanding.
> - “only works when the EC type is the same in the try expression as
> the calling function”[2] is misleading. `OUTCOME_TRYV(outcome::result<int,
> err>{err::success})` works inside a function returning
> `outcome::result<void>` given `err` is convertible to `std::error_code`.
>
>
> [1] https://ned14.github.io/outcome/tutorial/payload/
> [2] https://ned14.github.io/outcome/tutorial/default-actions/error-codes/
>
> --
> Vinícius dos Santos Oliveira
> https://vinipsmaker.github.io/
>

-- 
Vinícius dos Santos Oliveira
https://vinipsmaker.github.io/

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk