
-----Original Message----- From: On Behalf Of Niall Douglas via Boost Sent: Saturday, March 3, 2018 11:27 PM
I don't claim to understand all the implementation details, so sorry if this is dumb question:
What happened to the idea to encode failure or success in a single bit in
On 03/03/2018 21:11, mike via Boost wrote: the status_code_domain pointer, thus making the check if an operation succeeded trivial even in the type-erased case?
That was a potential workaround for Boost.System to not break existing code.
A complete rebuild like
doesn't need such hacks. It has a formal empty state for those users who won't risk the cost of a virtual function call. For everybody else, it costs one virtual function call at worst, usually not even that as the compiler will have speculatively inlined the implementation and/or the linker will have implemented the 'final' modifier.
It might not be necessary, but wouldn't it be a worthwhile optimization regardless? Even in the generic case it would work without any cross-module analysis and should generally make the compiler's task easier. It would also make the checks for failure or success constexpr (not sure if that is typically relevant). Or would it imply problematic tradeoffs?
Niall
Mike