C++: Using wrapper classes with stack implementation? -


my c++ instructor gave assignment told translate bunch of linked list functions linked stack functions using wrapper classes as possible. unfortunately, however, didn't explain them i'm not entirely sure how they're used nor how they're implemented.

as of right now, "stack_wrapper" class kind of looks this:

template<class s> struct node {     s data;     node<s>* next; };  template<class s> class stack_wrapper { public:     stack_wrapper();     stack_wrapper(const stack_wrapper<s>& altstack);     ~stack_wrapper();      const stack_wrapper<s>& operator = (const stack_wrapper<s>&);     void initialize();     bool isempty();     bool isfull();     void push(const s& newitem);     void pop(s& poppedelement);     void destroy();  protected:     stack_wrapper<s> *first;     stack_wrapper<s> *last; }; 

i suppose asking is: how start translating use wrappers?


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -