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

BitVecFlip

BitVecFlip Description Flip the value of bit at given index in bitvector. Changes 0 to 1 and 1 to 0.

Read More

BitVecSwap

BitVecSwap Description Efficiently swap the contents of two bitvectors. This is much faster than copying both bitvectors.

Read More

BitVecClone

BitVecClone Description Create a deep copy of a bitvector. The returned bitvector must be deinitialized when no longer needed.

Read More