Can't directly output STL Vector's iterator values
I'm having a problem when trying to output STL iterator values in C++. The following code generates an error - no matter what template target I'm going to use:

    template <typename T>
    void outputVector(vector<T> &v)
    {
    	typename vector<T>::const_iterator iter;
    	for(iter = v.begin(); iter != v.end(); iter++)
    	{
    		cout << *iter << endl;
    	}
    
The message ist

> no match for 'operator<<' in 'std::cout << iter.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = const Node*, _Container = std::vector<Node, std::allocator<Node> >]()'

When replacing the for loop with

	for(iter = v.begin(); iter != v.end(); iter++)
	{
		T t = *iter;
		cout << t << endl;
	}

everything works just fine.

Do you have any problem what the problem might be? The used classes do overload the "<<" operator.

Thanks in advance!

Can't directly output STL Vector's iterator values
===

I'm having a problem when trying to output STL iterator values in C++. The following code generates an error - no matter what template target I'm going to use:

    template <typename T>
    void outputVector(vector<T> &v)
    {
    	typename vector<T>::const_iterator iter;
    	for(iter = v.begin(); iter != v.end(); iter++)
    	{
    		cout << *iter << endl;
    	}
    
The message ist

> no match for 'operator<<' in 'std::cout << iter.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = const Node*, _Container = std::vector<Node, std::allocator<Node> >]()'

When replacing the for loop with

	for(iter = v.begin(); iter != v.end(); iter++)
	{
		T t = *iter;
		cout << t << endl;
	}

everything works just fine.

Do you have any problem what the problem might be? The used classes do overload the "<<" operator.

Thanks in advance!
