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 Tendencias
- 1. Lakers 49.8K posts
- 2. Dillon Brooks 6,561 posts
- 3. Giants 84.8K posts
- 4. Bron 24.2K posts
- 5. #WWERaw 69.6K posts
- 6. Patriots 129K posts
- 7. Dart 35.8K posts
- 8. Suns 18.6K posts
- 9. Drake Maye 24K posts
- 10. Collin Gillespie 1,961 posts
- 11. Diaz 34K posts
- 12. #AvatarFireAndAsh 2,712 posts
- 13. Devin Williams 7,662 posts
- 14. Ryan Nembhard 3,969 posts
- 15. Gunther 14.9K posts
- 16. Pats 16.1K posts
- 17. Devin Booker 2,569 posts
- 18. STEAK 10.4K posts
- 19. James Cameron 4,237 posts
- 20. Younghoe Koo 6,820 posts
Something went wrong.
Something went wrong.