Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Rust's Two Kinds of 'Assert' Make for Better Code (tratt.net)
3 points by ltratt on March 17, 2023 | hide | past | favorite | 2 comments


> Of course, there's no reason why you can't write your own equivalents of assert and debug_assert in C, or any other language, but having them built into a language (or standard library)

Doesn't C have both static_assert and assert as part of the standard library?


The static_assert is a compile-time check. And it's C++11 and later, not C.

That's about runtime vs compile time assertions.

The article talks about something completely different.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: