Boost logo

Boost :

Subject: Re: [boost] [outcome] Whether to default EC = error_code for result?
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2018-01-23 14:42:02


> Maybe, as others observed, you should call it <status_code> -- those codes
> are not necessarily errors.

Already ahead of you on that.

> So, are you saying you want `EC` with no default in `result` and `EC` to
> default to `std::error_code` in `outcome`?
> [snip]
> If what you are saying is true, that all non-trivial usage will be to
> compose one's own type, then you could provide `basic_result<T, EC>` to be
> used for building custom types: no defaults. Next, in another header you
> could provide an alias:
>
> ```
> template <typename T>
> using result = basic_result<T, std::error_code>;
> ```
> Similarly to what you do for `unchecked` and `checked`.

Yes that could work. So we'd gain a non-defaulted `basic_result` and
`basic_outcome` with typedefs to defaulted `result` and `outcome`. Nice.

Logged to https://github.com/ned14/outcome/issues/110

Niall

-- 
ned Productions Limited Consulting
http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/

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