Warning
This post was published 64 days ago. The information described in this article may have changed.
I have some UI layout code, and I was thinking of creating a new type to help keep my units straight.
/// Device independent pixels
struct Dip(f32)
impl Add for Dip { ... }
impl Mul for Dip { ... }
...
Is this always going to be as fast as raw f32
? I remember a C++ talk called something like "There are no zero cost abstractions".
7 posts - 6 participants
🏷️ rust_feed