Ignore:
Timestamp:
Mar 29, 2026, 11:03:25 PM (8 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
c1f17aa
Parents:
81ab5eb
Message:

3rd attempt at harmonizing isOp functions, e.g., isListed, isFirst, isLast

Location:
libcfa/src/collections
Files:
2 edited

Legend:

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

    r81ab5eb re6e250d  
    1010// Created On       : Wed Apr 22 18:00:00 2020
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Mar 29 21:20:44 2026
    13 // Update Count     : 101
     12// Last Modified On : Sun Mar 29 22:59:08 2026
     13// Update Count     : 104
    1414//
    1515
     
    188188
    189189static inline forall( tE &, tLinks & | embedded( tE, tLinks, dlink( tE ) ) ) {
    190         bool isListed( tE & node ) {
     190        bool listed( tE & node ) {
    191191          NOLOOSE(
    192192                verify( &node != 0p );
     
    195195          )
    196196          LOOSEONLY(
    197                 verify(false && "isListed is undefined");
     197                verify(false && "listed is undefined");
    198198                return true;
    199199          )
     
    204204                if ( ORIGIN_TAG_QUERY(( size_t)firstPtr) ) firstPtr = 0p;
    205205                return firstPtr == 0p;
    206         }
    207 
    208         bool isEmpty( dlist( tE, tLinks ) & list ) {            // deprecated
    209                 return empty( list );
    210206        }
    211207
     
    339335        }
    340336
    341         bool isFirst( tE & node ) {
     337        bool first( tE & node ) {
    342338                return recede( node );
    343339        }
    344340
    345         bool isLast( tE & node ) {
     341        bool last( tE & node ) {
    346342                return advance( node );
    347343    }
  • libcfa/src/collections/list2.hfa

    r81ab5eb re6e250d  
    1919// Created On       : Wed Apr 22 18:00:00 2020
    2020// Last Modified By : Peter A. Buhr
    21 // Last Modified On : Sun Mar 29 21:47:53 2026
    22 // Update Count     : 12
     21// Last Modified On : Sun Mar 29 22:59:31 2026
     22// Update Count     : 15
    2323//
    2424
     
    454454        }
    455455
    456         static inline bool isEmpty( dlist(tE, tLinks) & list ) __attribute__ ((deprecated));
    457         static inline bool isEmpty( dlist(tE, tLinks) & list ) {
    458                 return empty( list );
    459         }
    460 
    461         static inline bool isListed( tE & e ) {
     456        static inline bool listed( tE & e ) {
    462457          NOLOOSE(
    463458                verify (&e != 0p);
     
    469464          )
    470465          LOOSEONLY(
    471                 verify(false && "isListed is undefined");
     466                verify(false && "listed is undefined");
    472467                return true;
    473468          )
     
    516511        }
    517512
    518         bool isFirst( tE & node ) {
     513        bool first( tE & node ) {
    519514                // Probable bug copied from master
    520515                // should be `! recede(node)`
     
    524519        }
    525520
    526         bool isLast( tE & node ) {
     521        bool last( tE & node ) {
    527522                // ditto, vice versa
    528523                return advance( node );
Note: See TracChangeset for help on using the changeset viewer.