Skip to main content

impl_const_default

Macro impl_const_default 

Source
macro_rules! impl_const_default {
    ($($(
        #[doc = $doc:expr])*
        $(#[cfg($($cfg:tt)+)])?
        $(#[expect($($expected:tt)+)])?
        $(@$pub:ident)? $type:ty => $default:expr;
    )*) => { ... };
}
Available on crate features formatting or parsing only.
Expand description

Implement Default for the given type. This also generates an inherent implementation of a default method that is const fn, permitting the default value to be used in const contexts.