Hacker News new | ask | show | jobs
by jcelerier 2218 days ago
C++ allows expressing that more concisely though :p https://twitter.com/Cor3ntin/status/1264600096869691392
1 comments

That's because it's using constexpr. The equivalent in Rust would be const fn. This is using Rust traits.

The goal isn't to be concise, I think the goal is literally to just do it in the trait system