Apparently this is allowed by the language.
#include <iostream> int main() { int&& r = 10; r += 1; std::cout << r << '\n'; }The code prints 11, and the literal 10 can't be altered. Isn't r a reference to the constant 10?
Apparently this is allowed by the language.
#include <iostream> int main() { int&& r = 10; r += 1; std::cout << r << '\n'; }The code prints 11, and the literal 10 can't be altered. Isn't r a reference to the constant 10?