Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 434 Bytes

File metadata and controls

20 lines (13 loc) · 434 Bytes

Programming Micro Note 20161019

Container - constness issue

Source:
Cppreference - vector

Q:
I have constness issue when using self-defined container in the case of calling $begin()$ and $end()$

A:
Remember to define all 3 versions of begin()

iterator begin();
const_iterator begin() const;
const_iterator cbegin() const;  // Since C++11