Changes in libcfa/src/containers/list.hfa [f2d05e9:4d741e9]
- File:
-
- 1 edited
-
libcfa/src/containers/list.hfa (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/containers/list.hfa
rf2d05e9 r4d741e9 301 301 $prev_link(list_pos) = (Telem*) 0p; 302 302 } 303 304 static inline bool ?`is_empty(dlist(Tnode, Telem) &list) {305 assert( &list != 0p );306 $dlinks(Telem) *listLinks = & list.$links;307 if (listLinks->next.is_terminator) {308 assert(listLinks->prev.is_terminator);309 assert(listLinks->next.terminator);310 assert(listLinks->prev.terminator);311 return true;312 } else {313 assert(!listLinks->prev.is_terminator);314 assert(listLinks->next.elem);315 assert(listLinks->prev.elem);316 return false;317 }318 }319 320 static inline Telem & pop_first(dlist(Tnode, Telem) &list) {321 assert( &list != 0p );322 assert( !list`is_empty );323 $dlinks(Telem) *listLinks = & list.$links;324 Telem & first = *listLinks->next.elem;325 Tnode & list_pos_first = $tempcv_e2n( first );326 remove(list_pos_first);327 return first;328 }329 330 static inline Telem & pop_last(dlist(Tnode, Telem) &list) {331 assert( &list != 0p );332 assert( !list`is_empty );333 $dlinks(Telem) *listLinks = & list.$links;334 Telem & last = *listLinks->prev.elem;335 Tnode & list_pos_last = $tempcv_e2n( last );336 remove(list_pos_last);337 return last;338 }339 340 303 } 341 304
Note:
See TracChangeset
for help on using the changeset viewer.