view algs4-c++/src/ResizingArrayStack.hpp @ 3:ca59e5f5b29e

Initial, imcomplete, C++ version of ResizingArrayStack.
author Eris Caffee <discordia@eldalin.com>
date Tue, 26 May 2015 18:18:16 -0500
parents
children 310618f5e32a
line source
1 #ifndef RESIZINGARRAYSTACK_HPP
2 #define RESIZINGARRAYSTACK_HPP
4 #include <cstddef>
6 template <typename T>
7 class ResizingArrayStack {
9 public:
11 ResizingArrayStack( void );
12 ~ResizingArrayStack( void );
14 void push( T &item );
15 T pop( void );
17 bool is_empty( void );
18 size_t size( void );
20 // class iterator;
21 // friend class iterator;
22 // class iterator {
23 // };
25 private:
27 size_t N;
28 size_t max;
29 T *data;
31 void resize( size_t new_max );
32 };
36 #endif