W
William Payne
Consider this (templated) class member function:
template<typename Type>
void CircularContainer<Type>::insert(const Type& s)
{
vector<Type>::iterator itr = find(m_elements.begin(), m_elements.end(),
s);
// snip
}
m_elements is: std::vector<Type> m_elements; and it's declared in the
private section of the class CircularContainer. When I try to compile this
class, it chokes on the iterator - my compiler says:
circular_container.cpp:13: error: expected `;' before "itr"
and line 13 is:
vector<Type>::iterator itr = find(m_elements.begin(), m_elements.end(), s);
Where is my error? Hope I posted enough code for you to help me....
/ WP
template<typename Type>
void CircularContainer<Type>::insert(const Type& s)
{
vector<Type>::iterator itr = find(m_elements.begin(), m_elements.end(),
s);
// snip
}
m_elements is: std::vector<Type> m_elements; and it's declared in the
private section of the class CircularContainer. When I try to compile this
class, it chokes on the iterator - my compiler says:
circular_container.cpp:13: error: expected `;' before "itr"
and line 13 is:
vector<Type>::iterator itr = find(m_elements.begin(), m_elements.end(), s);
Where is my error? Hope I posted enough code for you to help me....
/ WP