Skip to content

It isn't possible to compare primitives with references of the same type #77374

Closed
@c410-f3r

Description

@c410-f3r

There are implementations of arithmetic operators like Add, Sub or Div for owned primitives mixed with references, however, comparison operators are only available for a single T.

Is there a technical decision preventing, e.g., impl PartialEq<&usize> for usize? It would be nice to be able to write 10i32 > some_i32_ref_var instead of 10i32 > *some_i32_ref_var.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.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