Skip to content

Tracking Issue for get_set_bit #147702

@AljoschaMeyer

Description

@AljoschaMeyer

Feature gate: #![feature(get_set_bit)]

This is a tracking issue for adding getters and setters of individual bits to all integral types.

Public API

This feature simplifies working with bitflags by adding to each integral type

  • a bit method retrieving whether the bit at some index (0 is the least significant bit) is set, and
  • a set_bit method for creating a new number, obtained form the old number by setting a specific bit to either zero or one.
impl /* u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize */ {
    pub const fn bit(self, index: u32) -> bool;
    pub const fn set_bit(self, index: u32, value: bool) -> Self;
}

Steps

Unresolved Questions

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions