3 ms·
> - It has powerful generics and macros, so people who want to write really clever code, can. To take a cue from the article: how do you write a generic max()
by pbsd 11y ago
> - It has powerful generics and macros, so people who want to write really clever code, can.
To take a cue from the article: how do you write a generic max() function for an arbitrary number of arguments?
- nemothekid 11y agoSomeone had commented this in a response on the site. macro_rules! max { ($e: expr) => { $e }; ($e: expr, $($rest: tt)*) => { max($e, max!($($rest)*)) } }