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
With CTFE, added backwards compatibly at a later date, this would be very useful for static initialization. No longer, to initialize a StaticMutex, would you have to write
staticST:StaticMutex = STATIC_MUTEX_INIT;
You could instead write
staticST:StaticMutex = Default::default();
This is really useful for standard library writers, because it just looks nicer. It's a small feature, but one that doesn't take anything away from anybody.
You also can just derive(Default) for types that should start out zeroed (for example, my heap implementation currently):
Thanks for the issue! This is actually currently being proposed in #1030 as well, so I'm going to close in favor of that, and feel free to weigh in on the PR!
With CTFE, added backwards compatibly at a later date, this would be very useful for static initialization. No longer, to initialize a StaticMutex, would you have to write
You could instead write
This is really useful for standard library writers, because it just looks nicer. It's a small feature, but one that doesn't take anything away from anybody.
You also can just derive(Default) for types that should start out zeroed (for example, my heap implementation currently):
Whereas with this change (and CTFE)
And, with a future, also backwards compatible change which adds in a C++ style
{}
syntaxor something like that.
The text was updated successfully, but these errors were encountered: