3 ms·
> Think of it as similar to naming C/C++ types with leading underscores. Yes, you could have gotten away with `typedef int _Bool;` for decades, but eventually t
by School-Cotton 4y ago
> Think of it as similar to naming C/C++ types with leading underscores. Yes, you could have gotten away with `typedef int _Bool;` for decades, but eventually the standard library will call that bet.
_Bool and all other names beginning with an underscore followed by a capital letter are explicitly reserved by the C++ standard.
Thus writing “typedef int _Bool” in user code is in fact unsound.
> I don’t think that’s what Steve meant
It’s actually quite clear what he meant, because “unsound” is a term of art in the Rust community and usually means something like “code that can be used in a way that invokes undefined behavior”. His explanation elsewhere in this thread of what he meant agrees with my interpretation, not yours.
- pjmlp 4y agoIn C23 bool is a proper type now.