åæ¨è«ã«ãã£ã¦ã³ã³ãã¤ã«æã«æ±ºå®ãããå
ä»ã¾ã§ããæ¸ãã¦ããã®ã
vector<int> v; vector<int>::iterator it = v.begin();
ããæ¸ããããã«ãªã
vector<int> v; auto it = v.begin();
ãvector
ã³ã³ãã¤ã©ã¯ç¥ã£ã¦ããã®ã§ãããã©ã¼ãªãã¨ã¯ã³ã³ãã¤ã©ã«ã¾ããã¡ãããã¨ãããã®ã§ã
ã¡ãªã¿ã«ãautoã«ãããã¦*, &, const/volatileã§ä¿®é£¾ãããã¨ãã§ãã¾ã
int a = 3; auto* p = &a; // int* p = &a; auto& r = a; // int& r = a; const auto& c = a; // const int& c = a;