From: JeanHeyd Meneide (phdofthehouse_at_[hidden])
Date: 2019-06-28 08:58:42


Dear Andrzej Krzemienski,

     Wrapping all of the used APIs -- and maintaining those wrappers for
any long-term, sustained period of time -- is not a feasible task or
architectural burden for many developers and their codebases.

     Transforming error returns + initialization sequences is a subject
best left to an entirely separate library, possibly using the Reflection TS
and (maybe) some form of Herb Sutter's proposed metaclasses idea. Doing
that in a generic way in today's C++ without these facilities is incredibly
difficult and likely to produce unwieldy boilerplate or a large number of
specially hand-crafted functions.

     Finally, out_ptr works with far more than just pointers. The
specification and implementation has out-of-the-box support for plenty of
RAII types, including retain_ptr/intrusive_ptr, unique_resource, my own
handle type (as shown in the example code), and more. In the San Diego C++
meeting LEWG was very pointed in asking whether this works for just
pointers or a large class of types: the design very deliberately works with
most pointer types. (Comparisons to nullptr are part of that deal, but
nothing requires nullptr initialization: the specification specifically
uses "it's value initalization" when it needs to create an empty Pointer
object.)

Sincerely,
JeanHeyd