Ai
1 Star 0 Fork 0

非启鹏程/c++

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
deque模拟stack.cpp 477 Bytes
一键复制 编辑 原始数据 按行查看 历史
非启鹏程 提交于 2022-04-27 09:25 +08:00 . add STL/stack/deque模拟stack.cpp.
template<class T, class Container = deque<T>>
class stack
{
public:
stack()
: _con()
{}
void push(const T& data)
{
_con.push_back(data);
}
void pop()
{
_con.pop_back();
}
T& top()
{
return _con.back();
}
const T& top()const
{
return _con.back();
}
size_t size()const
{
return _con.size();
}
bool empty()const
{
return _con.empty();
}
private:
Container _con;
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/dunqipeng/c1.git
git@gitee.com:dunqipeng/c1.git
dunqipeng
c1
c++
master

搜索帮助