The stl is full of definitions like this:
iterator begin ();
const_iterator begin () const;
As return value does not participate in overloa
Yes, the const
modifier affects overloading. If myvector
is const
at that point const
version will be called:
void stuff( const vector& myvector )
{
vector::const_iterator it = myvector.begin(); //const version will be called
}
vector myvector;
vector::const_iterator it = myvector.begin(); //non-const version will be called