Stream: general

Topic: Can we have a Integer supertrait?


Elichai Turkel (May 05 2020 at 07:18, on Zulip):

Hi,
How do people feel/think about an Integer supertrait? that will contain max_value and min_value and will probably depend on a lot of the arithmetic traits too

Elichai Turkel (May 05 2020 at 07:19, on Zulip):

This kind of "trait" is used very commonly in C++

Hanna Kruppe (May 05 2020 at 07:34, on Zulip):

There's an absolutely enormous design space for numeric traits (hierarchies), I would even say there is no single best design for it. libstd is a bad place to explore that kind of space since it's constrained by backwards compatibility and generally wants to be small/focused. There's the num-traits crate and some other crates that address this subject and don't have those constraints.

Last update: May 29 2020 at 17:25UTC