diff --git a/tutorial/Ntl01/Ntl01.cpp b/tutorial/Ntl01/Ntl01.cpp index 8629a9a1a..601a9e5ca 100644 --- a/tutorial/Ntl01/Ntl01.cpp +++ b/tutorial/Ntl01/Ntl01.cpp @@ -11,6 +11,9 @@ CONSOLE_APP_MAIN for(int i = 0; i < v.GetCount(); i++) LOG(v[i]); LOG("..and now iterators.."); - for(Vector::Iterator q = v.Begin(), e = v.End(); q != e; q++) + for(auto q = v.begin(), e = v.end(); q != e; q++) LOG(*q); + LOG("..and now range-for.."); + for(const auto& q : v) + LOG(q); } diff --git a/tutorial/Ntl01/init b/tutorial/Ntl01/init new file mode 100644 index 000000000..2c5eb4612 --- /dev/null +++ b/tutorial/Ntl01/init @@ -0,0 +1,4 @@ +#ifndef _Ntl01_icpp_init_stub +#define _Ntl01_icpp_init_stub +#include "Core/init" +#endif diff --git a/tutorial/Ntl10/Ntl10.cpp b/tutorial/Ntl10/Ntl10.cpp index 308561042..957c3ef2c 100644 --- a/tutorial/Ntl10/Ntl10.cpp +++ b/tutorial/Ntl10/Ntl10.cpp @@ -60,6 +60,9 @@ CONSOLE_APP_MAIN for(int i = 0; i < m.GetCount(); i++) LOG(m.GetKey(i) << ": " << m[i]); + + for(auto r : ~m) + LOG(r.key << ": " << r.value); DUMP(m.Find("2")); DUMP(m.Get("2"));