Пример #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();
	}