Из стандарта C ++ (§13.3.1 Функции-кандидаты и списки аргументов):
For non-static member functions, the type of the implicit object parameter is “reference to cv X” where X is the class of which the function is a member and cv is the cv-qualification on the member function declaration. [Example: for a const member function of class X, the extra parameter is assumed to have type “reference to const X”. ]
Итак, в вашем случае, если myvector
объект равен const
, компилятор выберет версию begin
, которая имеет неявный параметр объекта типа reference to const vector
, который является константной версией begin
.