template < typename...Args > void emplace_back(Args && ... args) { node *newdat = new node(mBack.backward(), new T(args...), &mBack); mBack.backward()->forward(newdat); mBack.backward(newdat); ++mSize; }
void push_back(const T & dat) { node *newdat = new node(mBack.backward(), new T(dat), &mBack); mBack.backward()->forward(newdat); mBack.backward(newdat); ++mSize; }
void pop_back() { if (mSize == 0) return; node *current = mBack.backward(); current->backward()->forward(&mBack); mBack.backward(current->backward()); delete current->data(); delete current; --mSize; }
node(const node & obj):mFront(obj.forward()), mBack(obj.backward()), mDat(obj.data()) { }
reverse_iterator rbegin() { return reverse_iterator(mBack.backward()); }
T & back() { if(!mBack.backward()->usable()) throw cov::error("E0005"); return *mBack.backward()->data(); }