Wiadomość napisana przez Sebastian Wittmeier via Std-Proposals <std-proposals@lists.isocpp.org> w dniu 16 lut 2025, o godz. 17:03:
AW: [std-proposals] Delayed const declaration For
int i = 0;
const i;
std::cout << &i << std::endl;
Would the compiler be allowed to optimize out the non-const phase of i and put it into read-only-memory?
For
int i = 0;
std::cout << &i << std::endl;
const i;
std::cout << &i << std::endl;
Would the compiler be allowed to relocate i between non-const memory and read-only-memory and print out two different addresses?
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals