| ▲ | plorkyeran 3 hours ago | |
C in C++20, A, B and C in C++23. This does sort of fall under a backwards compatibility issue, albeit not with C, as making D valid was considered too much of a breaking change. | ||
| ▲ | PhilipRoman an hour ago | parent [-] | |
I'm no C++ expert, but in P2012R0 it even gives this specific example, indicating that A is OK in c++20: [..] One recent real-world example by one of the authors is the following: Improving the following code:
by introducing a getter to have better encapsulation, suddenly caused the undefined behavior: | ||