Skip to main content

One doc tagged with "operator-overloading"

View all tags

Default Generic Type Parameters and Operator Overloading

After mastering Associated Types, we'll now explore two related features that make Rust's generic system even more ergonomic and powerful: default generic type parameters and operator overloading. Default parameters reduce the amount of boilerplate needed for common generic cases, while operator overloading allows us to specify custom behavior for operators like + and - on our own types.