-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Quantity::new const, or provide an alternative way to create constant quantities #251
Comments
Personally, I think a const FOO: Bar = Quantity {
dimension: PhantomData,
units: PhantomData,
value: 23.0,
}; at least w.r.t. correctness of dimensions and units. But for Should we consider creating a duplicate machinery for |
I haven't really thought down the path of As an aside I'm working on changes to |
I think this is necessary because a trait that requires a function/value to be available in const context cannot be implemented by heap-allocated types like More concretely we would probably have something like trait ConstConversion<V> {
type T: ConstConversionFactor<V>;
const COEFFICIENT: Self::T;
const CONSTANT: Self::T;
} and so on. |
See discussion starting at #26 (comment) and #250 (comment). Also see #165 for a general discussion about making as many functions as possible const.
The text was updated successfully, but these errors were encountered: