Bjorn Reese wrote:
On 10/05/18 00:37, Peter Dimov via Boost wrote:
- identifier-based category comparison
This states in Motivation that
"relying on address-based comparisons makes it impossible to declare category objects constexpr and makes it impossible to declare operator< constexpr"
Implementation adds the constexpr to operator<
"constexpr bool operator<(const error_category& rhs) const noexcept;"
with an as-if comment about the return value, which ends with an address comparison:
"return less
()(this, &rhs);" How can this be made constexpr?
It's constexpr if you never reach this line. That is, if at least one of the categories you're comparing has an identifier, op< is constexpr.
- message() into a caller-supplied buffer
This document refers to strerror_r as a glibc thing. It is also Posix, which is probably a better reference:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/strerror.html
I'm referring specifically to the Glibc version, which returns `char const*` so that the implementation can return literals instead of using the buffer. The POSIX version returns an `int` and always copies into the buffer.