expected-lite
expected-lite copied to clipboard
Use ``std::addressof`` instead of plain ``operator &``
I find myself often working with some COM
-like types, which I would like to wrap inside an expected
. Unfortunately, some of those types have an overloaded operator &
which perform a cleanup (don't ask why...). In fact, this constantly crashes, because expected-lite
performs a placement-new and requests the address via operator &
which then leads to a cleanup of unitialized ptrs.
I think, using std::addressof
instead of the plain operator &
should help here.