V
Vincent RICHOMME
Last question before to go to sleep :
let's say I have a class derived from std::list
template<typename T>
class List : public std::list<T>
{
static bool const is_ptr = is_pointer<T>::value;
public:
~List() { Clear(); }
inline void Add(T object) { push_back(object); }
inline void Clear(bool bDeallocate = true)
{
if (bDeallocate && is_ptr)
{
// CODE BELOW WORKS WITH A VECTOR - FOR A LIST
/*int count = this->size();
while ( count ){
delete this->operator[]( --count );
}*/
}
this->std::list<T>::clear();
}
inline int GetCount() { return size(); }
};
How can I parse my list from my derived class?
let's say I have a class derived from std::list
template<typename T>
class List : public std::list<T>
{
static bool const is_ptr = is_pointer<T>::value;
public:
~List() { Clear(); }
inline void Add(T object) { push_back(object); }
inline void Clear(bool bDeallocate = true)
{
if (bDeallocate && is_ptr)
{
// CODE BELOW WORKS WITH A VECTOR - FOR A LIST
/*int count = this->size();
while ( count ){
delete this->operator[]( --count );
}*/
}
this->std::list<T>::clear();
}
inline int GetCount() { return size(); }
};
How can I parse my list from my derived class?