impl_add_base_field

Macro impl_add_base_field 

Source
macro_rules! impl_add_base_field {
    ($alg_type:ty, $field_type:ty $(, ($type_param:ty, $param_name:ty))?) => { ... };
}
Expand description

Given two structs Alg and Field where Alg implements From<Field>, implement Add<Field> for Alg and Add<Alg> for Field.

All are implemented in the simplest way by using From to map the Field element to an Alg element and then applying the native add methods on Alg elements.