Skip to content

std::num::Checked{Add,Sub,Mul,Div} should have type parameters #15

@cuviper

Description

@cuviper

From @steveklabnik on February 11, 2015 1:35

Issue by lifthrasiir
Monday Apr 14, 2014 at 12:33 GMT

For earlier discussion, see rust-lang/rust#13510

This issue was labelled with: A-libs in the Rust repository


The corresponding std::ops traits have both the type of right hand side operand and the type of result, while Checked* traits do not (and always assume that both operands and result have the same type). There is no real reason to make Checked* traits behave differently from std::ops traits, and having them as is hampers advanced uses of operator overloading: for example, if the scalar type (e.g. DateTime) and difference type (e.g. Duration) are distinct from each other then the current scheme wouldn't work at all.

Copied from original issue: rust-num/num#59

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions