#ifndef STACK_H #define STACK_H #include #include #define DEFAULT_STACK_SIZE 4 enum class StackErr { ok, bad_alloc, empty, }; template class Stack { private: uint64_t len; uint64_t cap; T *data; public: Stack(); ~Stack(); std::expected pop(); std::expected peek(); StackErr push(T val); void print(); }; template Stack::Stack() { Stack new_stack; new_stack.data = new T[DEFAULT_STACK_SIZE]; new_stack.cap = 0; new_stack.len = 0; return new_stack; } template Stack::~Stack() { delete[] this->data; } #endif // !ST