25 clearGarbage(m_pFront);
28 bool empty()
const {
return !m_pBack; }
35 char *
backRaw()
const {
return m_pBack->m_Datum; }
36 char *
frontRaw()
const {
return m_pFront->m_Datum; }
54 static size_t clearGarbage(C_Link *p);
77 T &
back()
const {
return *
reinterpret_cast<T*
>(this->
backRaw()); }
82 template<
class...T_Args>
83 T &
push(T_Args&&...args) {
return *
new(this->
pushRaw()) T{std::forward<T_Args>(args)...}; }
90size_t C_RawQueue<N>::clearGarbage(C_Link *p)
114 ret =clearGarbage(m_pBack->m_Next);
120 ret =clearGarbage(m_pFront);
129 if (m_pFront == m_pBack)
135 C_Link *
const t =m_pFront;
137 t->m_Next =m_pBack->m_Next;
149 m_pBack =m_pBack->m_Next;
151 m_pBack =m_pBack->m_Next =
new C_Link;
164 return m_pBack->m_Datum;
185 recycled =m_pBack->m_Next;
186 m_pBack->m_Next =other.m_pFront;
188 m_pBack =other.m_pBack;
193 m_pFront =other.m_pFront;
194 m_pBack =other.m_pBack;
201 C_Link *last =m_pBack;
211 last->m_Next =recycled;
224 std::swap(m_pFront, other.m_pFront);
225 std::swap(m_pBack, other.m_pBack);
233 while (!this->empty())
244 reinterpret_cast<T*
>(this->frontRaw())->~T();
T & push(T_Args &&...args)
C_RawQueue(const C_RawQueue &another)=delete
C_RawQueue & operator=(const C_RawQueue &another)=delete
void splice(C_RawQueue &other)
void swap(C_RawQueue &other)
THE common namespace of bux library.