43
submitted 1 year ago by [email protected] to c/[email protected]
you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 1 points 1 year ago* (last edited 1 year ago)

Inline consts also let you perform static assertions, like asserting a type parameter is not a zero-sized type, or a const generic is non-zero. This is actually pretty huge since some checks can be moved from runtime to compile time (not a lot of checks, but some that were difficult or impossible to do at compile time before).

this post was submitted on 13 Jun 2024
43 points (97.8% liked)

Rust Programming

8850 readers
1 users here now

founded 6 years ago
MODERATORS