Answer the question
In order to leave comments, you need to log in
What exactly is made constant with this type definition?
What exactly is made constant in such a const std::vector<float>&
vector entry, a reference or the vector itself?
Answer the question
In order to leave comments, you need to log in
Constant vector. You can only call constant methods, you cannot reassign or somehow change them.
But where can there be any misunderstanding here? In C++, you can never change what references refer to. const/not const can only be what it refers to.
Edit: I originally incorrectly called it a constant reference here, but for good reason, it's called a constant reference.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question