Special member methods in c++ class methods

Insert image description here
As shown above, there are two very similar methods in the template class. There is a const modification after the function name of the second method, which means that this special constant method is used for constant objects of this type. It can be seen that the return value is a constant iterator, and its container object will not be modified by this iterator.
c++ has this syntax. Just remember it. Thanks

Guess you like

Origin blog.csdn.net/zhangzhangkeji/article/details/132982998