Closed
Description
It feels a bit redundant to have to say Default::default()
every time I need a new value of a type that has a Default
instance.
Especially so, compared to Haskell, where the same functionality is called def
.
Providing a free default()
function that forwards to Default::default()
seems to improve the situation.
The trait is still there, so if someone wants to be explicit and to say Default::default()
- it still works, but if imported as std::default::default;
, then the free function reduces typing and visual noise.