BitVecEmpty

Table of Contents

BitVecEmpty

Description

Check if bitvector is empty.

Parameters

NameDirectionDescription
bvinBitvector to check

Usage example (from documentation)

  if (BitVecEmpty(&flags)) { /* handle empty case */ }

Usage example (Cross-references)

    
    // Test empty check
    result = result && !BitVecEmpty(&bv);
    
    // Clear and check empty
    // Clear and check empty
    BitVecClear(&bv);
    result = result && BitVecEmpty(&bv);
    result = result && (BitVecLen(&bv) == 0);
    result = result && (BitVecLen(&bv) == 0);
    result = result && (BitVecCapacity(&bv) == 0);
    result = result && BitVecEmpty(&bv);
    result = result && (BitVecByteSize(&bv) == 0);
    result = result && (BitVecLen(&bv) == 65);
    result = result && (BitVecCapacity(&bv) >= 65);
    result = result && !BitVecEmpty(&bv);
    result = result && (BitVecByteSize(&bv) >= 9); // At least 9 bytes for 65 bits

Share :

Related Posts

BitVecCapacity

BitVecCapacity Description Get capacity of bitvector in bits.

Read More

BitVecClear

BitVecClear Description Clear all bits in bitvector without deallocating memory. Sets length to 0 but keeps allocated capacity.

Read More

BitVecReserve

BitVecReserve Description Reserve space for at least n bits in bitvector. Does not change the length, only ensures capacity.

Read More