码迷,mamicode.com
首页 > 编程语言 > 详细

C++LinkDeQueue

时间:2019-07-11 00:28:47      阅读:115      评论:0      收藏:0      [点我收藏+]

标签:nbsp   ack   sig   ++   get   back   typename   oid   kde   

#pragma once
#ifndef _LINKDEQUEUE_H_
#define _LINKDEQUEUE_H_

#include "linklist.h"

template<typename T, typename _Container = linklist<T>>
class linkdequeue{
protected:
using uint = unsigned int;
_Container c;
public:

linkdequeue() :c(){ }
explicit linkdequeue(const _Container &c) :c(c){ }
bool empty()const{ return c.empty(); }
uint size()const{ return c.size(); }
const _Container &getContainer() const{ return c; }
void push_back(const T &value){ c.push_back(value); }
void pop_back(){ c.pop_back(); }
void push_front(const T &value){ c.push_front(value); }
void pop_front(){ c.pop_front(); }
void clear(){ c.clear(); }
const T &front()const{ return c.front(); }
const T &back()const{ return c.back(); }
T &front(){ return c.front(); }
T &back(){ return c.back(); }

};

 


#endif // !_LINKQUEUE_H_

 

C++LinkDeQueue

标签:nbsp   ack   sig   ++   get   back   typename   oid   kde   

原文地址:https://www.cnblogs.com/MasterYan576356467/p/11167367.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!