Boost logo

Boost :

Subject: Re: [boost] [system] Would it be possible to trial a breaking change to Boost.System and see what happens?
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2018-01-15 00:01:10


> How would these tests be optimized if you moved the comparison into the
> category? The category test would be replaced with a virtual function
> call (which is arguably more expensive) but the error code value tests
> would still be executed.

Right now I must duplicate those tests at every use case site.

If they were inside the category instead, they'd be hot in the branch
predictor and microcode cache.

>>> Some parts of your proposal (namely, switching to `string_view`) do not
>>> have a clear migration path, especially for C++03 users.
>>
>> You didn't fully read my earlier email. There is no point using
>> std::string_view with earlier than C++ 17. And boost::string_view
>> doesn't have sufficient interop with std::string to substitute.
>>
>> The std::string_view message() is 100% C++ 17 or later only.
>
> My objection was not just about `std::string_view` being C++17-only,
> although it was part of it. Not all error categories can be ported to
> `std::string_view` in principle.

Is anybody actually generating a totally unique message per invocation
for the same error code which couldn't be cached and reused? I've never
seen it yet. Almost all use of message() is for printing to human
readable output.

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