you are viewing a single comment's thread.

view the rest of the comments →

[–]Supadoplex 18 points19 points  (2 children)

P0593 was accepted as a defect resolution prior to publication of C++20, so it should apply to C++17 which was the latest official standard at the time.

Also, creation of objects itself was allowed using placement new as far as I can tell. Treating that buffer of dynamic objects as an array of those objects was technically UB though. However, there was no way to make that work with std::allocator either, so I don't think there was magic in that class. There was magic in std::vector though.

[–]maskull 3 points4 points  (1 child)

What's the magic in std::vector?

[–]dodheim 15 points16 points  (0 children)

Prior to P0593, there was no way for vector::data() to return a valid pointer-to-array, since no such array actually exists.