Kylin/DataStructure/Stack.h
2023-12-27 10:29:16 +08:00

19 lines
423 B
C++

#ifndef STACK_H
#define STACK_H
#include "Object.h"
namespace Kylin {
template <typename T>
class Stack : public Object {
public:
virtual void push(const T &value) = 0;
virtual T pop() = 0;
virtual T &top() = 0;
const T &top() const { return const_cast<Stack *>(this)->top(); }
virtual void clear() = 0;
virtual size_t size() const = 0;
};
} // namespace Kylin
#endif // STACK_H