Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 4-5-1 prohibits sizeof(bool_type_variable)?
#2
I think this is because sizeof(bool) is implementation-defined according to ISO C++03 chapter 5.3.3.
If you want to code a portable serialization function, you have to store it in an integer with a guaranteed fixed size across all platforms (e.g. using uint8_t from stdint.h or your own type header)
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)