r/cpp • • Jul 29 '26

C++26: Reducing undefined behaviour

https://www.sandordargo.com/blog/2026/07/29/cpp26-reduces-undefined-behaviour
89 Upvotes

48 comments sorted by

View all comments

Show parent comment

3

u/Potterrrrrrrr Jul 29 '26

Yep, that was my takeaway too. Originally it would compile but was only defined behaviour if you hadn’t overridden delete or implemented a destructor (because neither would be able to be called without the compiler knowing the full type), because yeah like you said the compiler can’t prove any of those things with an incomplete type. Now it just rejects any ambiguity which makes a lot more sense.