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


ned Productions Limited Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at