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
Whilst this is not a high priority change at the moment (understandably there are far bigger fish to fry), this is a semi-common question on the IRC and I think it's good if we have some place to redirect questions to.
Instead of the current:
Real::pi::<float>()
this change would allow you to do:
float::pi()
or
typeT = float;T::pi()
This could also allow for neat things like a generic SizeOf trait: T::size_of(), which is far nicer than the current size_of::<T>(). Or maybe there could be an Init trait for default initializers: T::init().
The text was updated successfully, but these errors were encountered:
Issue by bjz
Sunday Jun 02, 2013 at 00:22 GMT
For earlier discussion, see rust-lang/rust#6894
This issue was labelled with: B-RFC, P-high in the Rust repository
This issue formalizes @pcwalton's RFC on the mailing list. This was also discussed in the 2013-05-14 meeting and in #6087. Steps towards this have already been made in #6462.
Whilst this is not a high priority change at the moment (understandably there are far bigger fish to fry), this is a semi-common question on the IRC and I think it's good if we have some place to redirect questions to.
Instead of the current:
this change would allow you to do:
or
This could also allow for neat things like a generic
SizeOf
trait:T::size_of()
, which is far nicer than the currentsize_of::<T>()
. Or maybe there could be anInit
trait for default initializers:T::init()
.The text was updated successfully, but these errors were encountered: