30 May
2017
30 May
'17
5:43 p.m.
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?