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 Trends
- 1. #GivingTuesday 19.8K posts
- 2. #twitchrecap 4,237 posts
- 3. Costco 44.5K posts
- 4. #AppleMusicReplay 6,747 posts
- 5. #csm222 4,749 posts
- 6. Susan Dell 4,562 posts
- 7. Lucario 20.6K posts
- 8. NextNRG Inc. 2,207 posts
- 9. Jared Curtis 1,312 posts
- 10. King Von 1,422 posts
- 11. Michael and Susan 3,082 posts
- 12. Trump Accounts 11K posts
- 13. #DragRace 1,356 posts
- 14. Carton 28.8K posts
- 15. BT and Sal N/A
- 16. Tiki 2,731 posts
- 17. WFAN N/A
- 18. Pentagon 75.9K posts
- 19. Hoss Cartwright N/A
- 20. Gallo 9,972 posts
Something went wrong.
Something went wrong.