I want to compile the following code segment:
Code:
namespace VE {
template <class T> class tset :public std::set<T>
{
public:
T* Find(const T& key){
iterator i = find(key);
return i == end() ? 0 : &(*i);
}
const T* Find(const T& key) const{
const_iterator i = find(key);
return i == end() ? 0 : &(*i);
}
};
}
This was originally developed in VC and now i am trying to port it to gcc.
However gcc produced these error messages:
Code:
tset.h: In member function `const T* VE::tset<S, T>::Find(const S&):
tset.h:39: error: expected `;' before "i"
tset.h:40: error: `i' undeclared (first use this function)
tset.h:40: error: (Each undeclared identifier is reported only once for each function it appears in.)
tset.h: In member function `const T* VE::tset<S, T>::Find(const S&) const':
tset.h:45: error: `const_iterator' undeclared (first use this function)
tset.h:45: error: expected `;' before "i"
tset.h:46: error: `i' undeclared (first use this function)
Any idea on how to solve this problem is appreciated