Logarithmus / typed_units

Next-generation crate for compile-time dimensional analysis
GNU General Public License v3.0
0 stars 0 forks source link

Strong aliases for small `typenum` numbers like `P1`, `P2`, ..., `P4` #1

Closed Logarithmus closed 2 years ago

Logarithmus commented 2 years ago

Implement some sort of downcasting facility to shorten compile errors. Now P4 is expanded to PInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>>. It would be nice to have struct Plus4, which would be converted to PInt<...> for computation & then converted back to another strong alias.

Implementation will likely involve fighting orphan rule & using macros.

Logarithmus commented 2 years ago

Using const generic approach like here https://docs.rs/nalgebra/latest/nalgebra/base/dimension/struct.Const.html

Logarithmus commented 2 years ago

Shorten rustc compilation errors for const generics:

Logarithmus commented 2 years ago

Closed by d0b41eca0a12681a8982fb669ba678a4bd814aaf