Skip to content

Introduce derive macros #312

Closed as not planned
Closed as not planned
@baboon25

Description

@baboon25

I think it would be quite neat to have derive macros for all num-traits and this shouldn't be breaking.

Use cases would mostly to write simple wrappers as such to make trait implementations easier down the line, but there could be other benefits from this as well:

#[derive(Float, FloatCore)
struct Float<F>(F) where F: Float + FloatCore;

#[derive(PrimInt)
struct Integer<I>(I) where F: PrimInt;

trait Foo{}

//not necessary to implement f32, f64 directly
impl<F> Foo for Float<F>{}

//same here for u8, i8, u16, ...
impl<I> Foo for Integer<I>{}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions