示例#1
0
	void push_front(const T & dat)
	{
		node *newdat = new node(&mFront, new T(dat), mFront.forward());
		mFront.forward()->backward(newdat);
		mFront.forward(newdat);
		++mSize;
	}
示例#2
0
	template < typename...Args > void emplace_front(Args && ... args)
	{
		node *newdat = new node(&mFront, new T(args...), mFront.forward());
		mFront.forward()->backward(newdat);
		mFront.forward(newdat);
		++mSize;
	}
示例#3
0
	void pop_front()
	{
		if (mSize == 0)
			return;
		node *current = mFront.forward();
		current->forward()->backward(&mFront);
		mFront.forward(current->forward());
		delete current->data();
		delete current;
		--mSize;
	}
示例#4
0
	bool empty() const
	{
		return !mFront.forward()->usable();
	}
示例#5
0
	node(const node & obj):mFront(obj.forward()), mBack(obj.backward()), mDat(obj.data())
	{
	}
示例#6
0
	iterator begin()
	{
		return iterator(mFront.forward());
	}
示例#7
0
	T & front()
	{
		if(!mFront.forward()->usable())
			throw cov::error("E0005");
		return *mFront.forward()->data();
	}