yohhoyの日記

技術的メモをしていきたい日記

2012-02-12から1日間の記事一覧

非メンバ関数版 begin/end のすゝめ

C++

C++11では新しく非メンバ関数のstd::begin, std::endが導入された。Elements of Modern C++ Style では、コンテナクラスcのメンバ関数c.begin(), c.end()ではなく、常に非メンバ関数版を利用するよう推奨している。 #include <vector> std::vector<int> v; int a[100]; st</int></vector>…