Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/containers/list.hfa

    rf2d05e9 r4d741e9  
    301301                $prev_link(list_pos) = (Telem*) 0p;
    302302        }
    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 
    340303}
    341304
Note: See TracChangeset for help on using the changeset viewer.