- "GotW #97: Assertions (Difficulty: 4/10)" by Herb Sutter - 6 Updates
- [Jesus Loves You] Time is approaching - 3 Updates
- Merry CHRISTmas! - 11 Updates
- "Firsts in 2020 (or, A little dose of good news)" by Herb Sutter - 1 Update
- 2019 wish list - 1 Update
- Strange compiler warning... - 2 Updates
- Release of (X)Emacs CC Mode version 5.35 - 1 Update
Paavo Helde <myfirstname@osa.pri.ee>: Jan 05 11:14AM +0200 05.01.2021 03:23 Lynn McGuire kirjutas: > "GotW #97: Assertions (Difficulty: 4/10)" by Herb Sutter > https://herbsutter.com/2021/01/01/gotw-97-contracts-part-1-assertions-and-postconditions/ > Wow, we do not have any asserts in our 450,000 lines of C++ code. For comparison, we have 7708 asserts in 600,000 lines of C++ code. I guess this depends on the project type very much. |
spudisnotyourbud@grumpysods.com: Jan 05 09:27AM On Tue, 5 Jan 2021 11:14:29 +0200 >> Wow, we do not have any asserts in our 450,000 lines of C++ code. >For comparison, we have 7708 asserts in 600,000 lines of C++ code. I >guess this depends on the project type very much. Presumably in the production version they're disabled by a build option? |
Bonita Montero <Bonita.Montero@gmail.com>: Jan 05 10:58AM +0100 I've got my own assert-/assume-header: #pragma once #include <cassert> #if !defined(assume) #if defined(_MSC_VER) #define assume(e) (__assume(e)) #elif defined(__GNUC__) #define assume(e) \ { \ if( !(e) ) \ __builtin_unreachable(); \ } #else #define assume(e) ((void)0)
Subscribe to:
Post Comments (Atom)
|
No comments:
Post a Comment