Boost logo

Boost :

Subject: Re: [boost] [next gen future-promise] What to call the monadic returntype?
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2015-05-25 10:59:53


On 25 May 2015 at 15:51, Peter Dimov wrote:

> Niall Douglas wrote:
>
> > https://svn.boost.org/trac/boost/wiki/BestPracticeHandbook#a8.DESIGN:Stronglyconsiderusingconstexprsemanticwrappertransporttypestoreturnstatesfromfunctions
>
> This section is called
>
> "(Strongly) consider using constexpr semantic wrapper transport types to
> return states from functions"
>
> but I see nothing constexpr in it - the result of calling ::open can never
> be constexpr.
>
> Could you perhaps elaborate a bit on the "constexpr semantic" part?

I was referring to the return type of:

std::expected<
  std::expected<
    std::shared_ptr<handle_type>,
    std::error_code>,
  std::exception_ptr>

This should constexpr reduce into no assembler output where the
compiler can see the implementation. In other words, returing an
error_code is as if returning a naked error_code from the point of
view of opcodes generated - std::expected "disappears".

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