-
Notifications
You must be signed in to change notification settings - Fork 216
Closed
Labels
Description
The implementation of class template proxy currently uses char arrays for in-place object construction. While functional, accessing the underlying object leads to UB. We propose changing the element type to std::byte for improved readability and alignment with C++ standards.
According to @frederick-vs-ja:
Such in-place-new ends the lifetime of the enclosing complete object and the nested objects that overlap with the newly created object due to [basic.life]/1.5. And then any further non-static member function invocation, including destruction, on such an enclosing object (e.g. a
proxyobject) will be UB as per [basic.life]/6.2 and /7.2.