Skip to content

Pointwise addition (and multiplication) for array struct members? #342

@matthiasgoergens

Description

@matthiasgoergens

Could we make point-wise addition (and multiplication etc) work for structs (and enums etc) that contain arrays as well?

#[derive(Add)]
struct<T> MyStruct {
    x: [T; 32],
    y: T,
}

At the moment, this fails.

We have a similar failure for tuples:

#[derive(Add)]
struct PointArray {
    a: i32,
    xy: (i32, i32),
    z: i32,
}

Metadata

Metadata

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions