From: Beman Dawes (bdawes_at_[hidden])
Date: 2006-06-29 11:16:45
"Christopher Kohlhoff" <chris_at_[hidden]> wrote in message
> Beman Dawes <bdawes_at_[hidden]> wrote:
>> I'm very curious to hear if people think the newer names are
>> an improvement over the TR2 versions.
> What about maybe ditching the member functions sysno_value() and
> errno_value() entirely and instead having additional free
> function overloads:
> sysno_t to_sysno(error_code ec);
> errno_t to_errno(error_code ec);
> And the only way to set an error code is by assignment:
> ec = 1234; // sysno
> ec = error_code(1234, from_errno);
That would simplify the interface, but I'm worried about ease-of-use in
typical use scenarios. Ease-of-use was the motivation for the current
> Some quick notes on the implementation (sorry for the noise if
> someone has already mentioned them):
> - I notice that you only use strerror() on POSIX platforms. On
> some platforms this is not threadsafe, and strerror_r() needs
> to be used instead. From memory this function's behaviour can
> differ a bit between various platforms as well.
> - The ::LocalFree() usage isn't exception safe.
> in the implementation of what() for an example.
Thanks, I've marked up the source code with you note and will make changes