Cv qualifiers, such as const , are applicable to the fact that to their left, if there is nothing, in which case they apply to the law. For string const& , const is applied to the string on the left. For const string& , const is applied to the string on the right. That is, they are links to const string , so in this case it does not matter.
Some people prefer to have it on the left (e.g. const int ), because it reads from left to right. Some people prefer to have it on the right (e.g. int const ) to avoid using a special case ( int const * const more consistent than const int* const , for example).
Joseph mansfield
source share