You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const fnhas landed in Rust stable! It would be really helpful in one of my projects if nalgebra adopted it for constructors. The shortlist of types I need is Point2, Point3, Vector2, Vector3, UnitComplex, UnitQuaternion. But it probably makes sense for every type in the library.
Things like UnitComplex::new might not work due to compile-time restrictions on FP math, but I'm happy to work around that with UnitComplex::from_cos_sin_unchecked or whatever else makes sense.
Adding the keyword is a simple enough change (at least I hope!), but it will break on older compilers and I don't know your policy on Rust version compatibility.
The text was updated successfully, but these errors were encountered:
I don't believe this is possible quite yet! The current level of const_fn support doesn't include functions with trait bounds. Not only do we need this feature to mark constructors as const in nalgebra (because of the pervasive N: Scalar, R: Dim, C: Dim, S: Storage bounds), but we need this feature to make the constructors in generic-arrayconst, too.
const fn
has landed in Rust stable! It would be really helpful in one of my projects if nalgebra adopted it for constructors. The shortlist of types I need isPoint2
,Point3
,Vector2
,Vector3
,UnitComplex
,UnitQuaternion
. But it probably makes sense for every type in the library.Things like
UnitComplex::new
might not work due to compile-time restrictions on FP math, but I'm happy to work around that withUnitComplex::from_cos_sin_unchecked
or whatever else makes sense.Adding the keyword is a simple enough change (at least I hope!), but it will break on older compilers and I don't know your policy on Rust version compatibility.
The text was updated successfully, but these errors were encountered: