#include <iostream> #include <vector> using namespace std; class TestClass { public: TestClass() {} }; int main() { // コンパイラが型を推論してくれるので長いクラス名書かなくていい。 auto test = new TestClass(); vector<string> strs { "one", "two", "three" }; // 型名が長くなりがちなIterator関係もスッキリ // (とはいえ range based for を使う方がスッキリする) for (auto it = strs.begin(); it != strs.end(); it++) { cout << *it << endl; } delete test; return 0; }