On Tue, May 30, 2017 at 10:53 AM, Niall Douglas via Boost < boost@lists.boost.org> wrote:
On 30/05/2017 18:43, Peter Dimov via Boost wrote:
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?
I'm still pondering your idea on this for the runtime checked editions. So far I am liking it, but I need to sleep on it some more.
But there was still a large minority of folk who want all-narrow observers. They haven't voiced anything to say they have changed their minds.
I currently, roughly speaking, find approx 50% in favour of a runtime checked edition, approx 40% in favour of a statically checked edition.
Emil and Vicente make up the 10% of folk who want something completely different.
It is probably not a good idea to measure correctness by popular opinion, especially if the popular opinion originates in the group that won't use exceptions "because they're slow". In my experience such people will always find "Overhead!!!" in any implementation.