http://qiita.com/SaitoAtsushi/items/d26a5cfa5453d8d91b63
のコードを参考に STL や template を勉強中。
今回目に止まって自分が知らなかったものは
template<class T>
typename continuous<T>::const_iterator continuous<T>::begin(void) const {
return data.cbegin();
}
のcbegin()というメソッド。
以下を見つけた。
http://stackoverflow.com/questions/12001410/what-is-the-reason-behind-cbegin-cend
Now, we have syntactic assurances that SomeFunctor cannot modify the elements of the vector (without a const-cast, of course).
普通のbegin()/end()を使った場合は要素のconstnessが保証できないので、cbegin()/cend()が導入された、という僕の解釈。