M
Markus Dehmann
I want to derive from std::set, like shown below. But when I try to
declare an iterator over the contained elements I get an error, see
the twp uncommented lines:
#include <set>
template<class T>
class MySet : public std::set<T>{
public:
MySet() : std::set<T>() {}
void foo(){
// const_iterator it; // error: `const_iterator' undeclared (first
use this
function)
// std::set<T>::const_iterator it; // error: expected `;' before
"it"
}
};
I thought const_iterator should be a member of this class (since I am
deriving from std::set). What am I doing wrong?
Thanks!
Markus
declare an iterator over the contained elements I get an error, see
the twp uncommented lines:
#include <set>
template<class T>
class MySet : public std::set<T>{
public:
MySet() : std::set<T>() {}
void foo(){
// const_iterator it; // error: `const_iterator' undeclared (first
use this
function)
// std::set<T>::const_iterator it; // error: expected `;' before
"it"
}
};
I thought const_iterator should be a member of this class (since I am
deriving from std::set). What am I doing wrong?
Thanks!
Markus