I am trying to add an iterator to a class template. The class is not much more than an encapsulated standard library vector, which some added features. The compiler chokes pretty hard on the snippet below. Any tips appreciated, or just point me towards an online example of this somewhere. Much thanks!

Code:

#ifndef POLYNOMIAL_INCLUDE
#define POLYNOMIAL_INCLUDE
#include <vector>
template <class T>
class Polynomial
{
public:
// other stuff goes here, chopped out for brevity
typedef std::vector<T>::iterator iterator ;
typedef std::vector<T>::const_iterator const_iterator ;
typedef std::vector<T>::reverse_iterator reverse_iterator ;
typedef std::vector<T>::const_reverse_iterator const_reverse_iterator ;
iterator begin() const ;
iterator end() const ;
private:
std::vector<T> terms_ ;
} ;
template <typename T> Polynomial<T>::iterator
Polynomial<T>::begin() const
{
return terms_.begin() ;
}
template <typename T> Polynomial<T>::iterator
Polynomial<T>::end() const
{
return terms_.end() ;
}
#endif // POLYNOMIAL_INCLUDE