approx
approx copied to clipboard
Add derive macros
Hello,
here is my take on #43 :smiley: I worked on AbsDiffEq first, it's still a draft obviously.
I added RelativeEq support, they mutualize nicely so UlpsEq should be pretty straightforward. I also added support for generics, but TBH I don't really know where to go from there, I miss examples of real use-cases I guess. Should I add a "shortcut" to specify one generic type to use as the backing type, something like
#[derive(AbsDiffEq)]
#[approx(generic = T)]
struct Foo<T> {
value: T,
...
}
or keep it like I did and allow to not necessarily reuse T's characteristics, but be more verbose if you do?
For anyone looking out for this topic: It seems that development of this crate is stalled. I have written my own lib approx-derive to solve the problem of non-existing derive macros.
Hey there. I have forked the approx crate under https://crates.io/crates/approxim. I have already included many PRs of the original approx crate such as https://github.com/brendanzab/approx/pull/57, https://github.com/brendanzab/approx/pull/67, https://github.com/brendanzab/approx/pull/69, https://github.com/brendanzab/approx/pull/83, https://github.com/brendanzab/approx/pull/84, https://github.com/brendanzab/approx/pull/87, https://github.com/brendanzab/approx/pull/90, https://github.com/brendanzab/approx/pull/91, https://github.com/brendanzab/approx/pull/92. This new crate approxim should work as a drop-in-replacement for approx. Feel free to try it out and let me know what you think.