ever see those videos pointing out how bools can be described by other information? generally, bools are often used to describe whether something exists or not "isPublished", true or false? no, it has a publish date. it's obviously published. tutorial ah example but, anyway
One of the core learnings for me from Meeting C++ 2025 was when James McNellis showed that bool has 3 not two possible values. Thats its not just true and false, but can also be undefined/not initialized.
This gonna get clearer when the lightning talk gets published. While bool is true or false, it occupies often a byte in memory, which can hold more states then the two. Which leads to problems with corrupted data, the optimizer assuming only two values or logic building on this.
Your initial comment is well worth remembering (even if off topic WRT the slide). bools in API should (most of the time) be inspection of something in an object, not an exposure of a bool member value/field.
United States トレンド
- 1. #ALLOCATION 232K posts
- 2. #JUPITER 232K posts
- 3. The BIGGЕST 428K posts
- 4. #GivingTuesday 9,511 posts
- 5. #GMMTVxTPDA2025 636K posts
- 6. Good Tuesday 29.5K posts
- 7. rUSD N/A
- 8. Kanata 24.6K posts
- 9. #AreYouSure2 54.3K posts
- 10. JOSSGAWIN AT TPDA2025 93.8K posts
- 11. Michael Dell N/A
- 12. JIMMYSEA TPDA AWARD 2025 67.2K posts
- 13. Snow Day 7,568 posts
- 14. Dart 39.4K posts
- 15. Costco 29.9K posts
- 16. Penny 22.5K posts
- 17. Pentagon 57K posts
- 18. Bron 26.6K posts
- 19. Hololive 15.8K posts
- 20. Dillon Brooks 8,329 posts
Something went wrong.
Something went wrong.