The STL
is full of definitions like this:
iterator begin ();
const_iterator begin () const;
As return value does not participate in overloading resolution, the only difference here is the function being const
. Is this part of the overloading mechanism? What is the compiler's algorithm for resolving a line like:
vector<int>::const_iterator it = myvector.begin();
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…