Skip to content

Tracking Issue for wrapping_int_assign_impl #93204

Closed
@kellerkindt

Description

@kellerkindt

Feature gate: #![feature(wrapping_int_assign_impl)]

This is a tracking issue for adding basic integer operations to the Wrapping type:

let mut value = Wrapping(2u8);
value += 3u8;
value -= 1u8;
value *= 2u8;
value /= 2u8;
value %= 2u8;
value ^= 255u8;
value |= 123u8;
value &= 2u8;

As well as

let mut value = Wrapping(2u8);
let _: Wrapping<u8> = value + 3u8;
let _: Wrapping<u8> = value - 1u8;
let _: Wrapping<u8> = value * 2u8;
let _: Wrapping<u8> = value / 2u8;
let _: Wrapping<u8> = value % 2u8;
let _: Wrapping<u8> = value ^ 255u8;
let _: Wrapping<u8> = value | 123u8;
let _: Wrapping<u8> = value & 2u8;

Steps / History

Unresolved Questions

  • Is this reasonable?

This is analog to the implementation for the Saturating type here #92354

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-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