what's the difference between std::vector<T> const &
and const std::vector<T> &
?
I'm used to const T &
, but this "T const &
" is different to me.
and forgive me for my ignorance.
what's the difference between std::vector<T> const &
and const std::vector<T> &
?
I'm used to const T &
, but this "T const &
" is different to me.
and forgive me for my ignorance.
They are completely equal.
You can verify this by trying to compile the following code and see how the compiler complains about a redefinition:
#include <vector>
void f(std::vector<int> const &) {}
void f(const std::vector<int> &) {} // error: redefinition