Skip to content

Add std.DynamicBitSet.setAll & unsetAll #22288

@nurpax

Description

@nurpax

Zig Version

0.14.0-dev.2384+cbc05e0b1

Steps to Reproduce and Observed Behavior

var map = std.DynamicBitSet.initEmpty(allocator, 100);
map.unsetAll(); // error

However, unsetAll and setAll functions exist but they're not exposed in the DynamicBitSet although they can be called through map.unmanaged.unsetAll/setAll.

I think it'd make sense to have wrappers for these just like there are for most other operations, like f.ex. toggleAll:

    pub fn toggleAll(self: *Self) void {
        self.unmanaged.toggleAll();
    }

Expected Behavior

var map = std.DynamicBitSet.initEmpty(allocator, 100);
map.unsetAll(); // compiles
map.setAll(); // compiles

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions