Skip to content

ListEmpty

ListEmpty

Description

Check whether list has no items.

Parameters

Name Direction Description
l in List to query.

Success

true when list length is 0.

Failure

false

Usage example (Cross-references)

Usage examples (Cross-references)
    
    static bool test_list_len_empty(void) {
        WriteFmt("Testing ListLen and ListEmpty\n");
    
        typedef List(int) IntList;
    
        bool result = (ListLen(&list) == 0);
        result      = result && ListEmpty(&list);
    
        ListPushBackR(&list, 10);
    
        result = result && (ListLen(&list) == 2);
        result = result && !ListEmpty(&list);
    
        ListClear(&list);
        ListClear(&list);
        result = result && (ListLen(&list) == 0);
        result = result && ListEmpty(&list);
    
        ListDeinit(&list);
Last updated on