   iterator confusion, why doesn't this compile?
  just a syntax error I'm sure but the following code looks fine to me and wont compile... mind you i'm not too hot on iterators so i may have the wrong end of the stick#include <map>#include <map>#include <iterator>#include <iostream>class foo{public:foo() {};~foo() {};};template <class T>class bar{public:std::map<int, T*> things;std::map<int, T*>::iterator get_begin_iterator();std::map<int, T*>::iterator get_end_iterator();bar() {};~bar() {};};template <class T>std::map<int, T*>::iterator bar<T>::get_begin_iterator(){return things.begin();}int main(){bar<foo> a;std::map<int, foo*>::iterator i = a.get_begin_iterator();std::map<int, foo*>::iterator end = a.get_end_iterator();while(i != end){/* do something */i++;}}the errors i get are:iterator_test.cpp:18: error: expected `;' before "get_begin_iterator"iterator_test.cpp:19: error: expected `;' before "get_end_iterator"iterator_test.cpp:25: error: expected constructor, destructor, or type conversion before "bar"iterator_test.cpp:25: error: expected `;' before "bar"iterator_test.cpp: In function `int main()':iterator_test.cpp:34: error: 'class bar<foo>' has no member named 'get_begin_iterator'iterator_test.cpp:35: error: 'class bar<foo>' has no member named 'get_end_iterator'
  You're missing a few typename keywords in the right spots. Ex:template <class T>class bar{public:std::map<int, T*> things;typename std::map<int, T*>::iterator get_begin_iterator();typename std::map<int, T*>::iterator get_end_iterator();bar() {};~bar() {};};;  note that typename is only required inside template declarations...   ;  ahh yes, always forget my template syntax!   