korken89 / fugit

`fugit` provides a comprehensive library of `Duration` and `Instant` for the handling of time in embedded systems, doing all it can at compile time.
Apache License 2.0
56 stars 16 forks source link

Lift const values to compiletime with `typenum` #48

Open Ben-PH opened 5 months ago

Ben-PH commented 5 months ago

Const generics are quite restrictive in what you can do with them, and integrating them into reverse dependencies. This PR refactors the use of const generics to use types that encapsulate integer behavior, where choice of value is a one-time choice at compile time.

From a technical standpoint, this PR should be ready to go, however from a documentation standpoint, there is stull much missing:

In my personal project, const generics have reared their ugly head when trying to use fugit. Instead of keeping these changes to myself, I present these changes upstream for your consideration, and if it is agreed to by the community, adoption.

Thank you.

burrbull commented 5 months ago

Edit by korken89: Manners please.

Ben-PH commented 5 months ago

EDIT: After learning from korken

The original comment is available in GitHub's edit box, no need to reiterate.

korken89 commented 5 months ago

@Ben-PH The original comment is available in GitHub's edit box, no need to reiterate.