Skip to content

Commit

Permalink
serialization: silence warning about shifting uint8_t by 8
Browse files Browse the repository at this point in the history
Some compilers are stupid and give a warning on this line when `T = uint8_t`, even though it will never run
  • Loading branch information
jeffro256 committed Nov 8, 2024
1 parent 9866a0e commit eb6f12c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/serialization/binary_archive.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ struct binary_archive<true> : public binary_archive_base<true>
{
for (size_t i = 0; i < sizeof(T); i++) {
stream_.put((char)(v & 0xff));
if (1 < sizeof(T)) v >>= 8;
if constexpr (1 < sizeof(T)) { v >>= 8; }
}
}

Expand Down

0 comments on commit eb6f12c

Please sign in to comment.