Skip to content

Commit

Permalink
fix the stream operator of bitfield flags, to print hex
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidn committed Oct 20, 2024
1 parent 4be0546 commit 0fafdc3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/libtorrent/flags.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ see LICENSE file.
#define TORRENT_FLAGS_HPP_INCLUDED

#include <type_traits> // for enable_if

#if TORRENT_USE_IOSTREAM
#include <iosfwd>
#include <iomanip>
#endif

namespace libtorrent {

Expand Down Expand Up @@ -105,7 +109,7 @@ struct bitfield_flag

#if TORRENT_USE_IOSTREAM
friend std::ostream& operator<<(std::ostream& os, bitfield_flag val)
{ return os << static_cast<UnderlyingType>(val); }
{ return os << std::hex << std::uint64_t(static_cast<UnderlyingType>(val)); }
#endif

private:
Expand Down

0 comments on commit 0fafdc3

Please sign in to comment.