2 ms·
Well no, for std::vector<int> t = {0, 1}; t[0] calls operator[], which returns an int&. This is precisely an lvalue reference, which is kind of like a mem
by Leszek 12y ago
Well no, for
std::vector<int> t = {0, 1};
t[0] calls operator[], which returns an int&. This is precisely an lvalue reference, which is kind of like a memory address, but int& is a type in its own right. Calling it a "reference object" is not entirely correct, but it's also not entirely incorrect. And let's not get started on vector<bool>...