With the following implementation, I'm attempting to answer my question:
class wlist
{
private:
std::list<void*> m_list;
public:
unsigned int size () { return m_list.size(); }
bool empty () { return m_list.empty(); }
void pop_back () { m_list.pop_back(); }
void pop_front () { m_list.pop_front(); }
};
class qwertyWrap : public wlist
{
public:
int getNumber() { ptr->getNumber(); }
void setNumber(int x) { ptr->setNumber(x); }
private:
qwerty* ptr;
};
class qwerty
{
public:
int getNumber();
void setNumber(int x);
};
class asdf
{
public:
int getElement();
void setElement(int x);
private:
/* Question */
/* Can the following declaration be substituted by qwertyWrap keyboard ??? */
list<qwerty*> keyboard; or qwertyWrap keyboard;
};
Question: Can I substitute "qwertyWrap keyboard" in place of "list keyboard" in class asdf and achieve the same functionality as that of a STL list????