Boost logo

Boost :

Subject: Re: [boost] [outcome] Second high level summary of review feedback accepted so far
From: Peter Dimov (lists_at_[hidden])
Date: 2017-05-30 17:43:21


Niall Douglas wrote:

> Do you accept that the static checked and runtime checked varieties are
> orthogonal user bases? There is a camp of users who strongly prefer no
> runtime overhead and static checking.

Why are their needs not served by value_if?

    auto r = function();

    if( auto* p = r.value_if() )
    {
        // use *p
        // no runtime overhead on using *p
        // static checkers know use of *p implies p != nullptr
    }

Between this pattern and using `assert( r.has_value() )` directly to advise
the static checker, are we not covered?


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