pflib v3.9.0-rc3-11-g2537d8f
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
Hex.h
1#pragma once
2
3#include <iomanip>
4
5namespace pflib::packing {
6
15template <typename WordType, std::size_t HexWidth = 2 * sizeof(WordType)>
16struct hex {
17 WordType& word_;
18 hex(WordType& w) : word_{w} {}
19 friend inline std::ostream& operator<<(
21 os << "0x" << std::setfill('0') << std::setw(HexWidth) << std::hex
22 << h.word_ << std::dec;
23 return os;
24 }
25};
26
27} // namespace pflib::packing
T hex(T... args)
T setfill(T... args)
T setw(T... args)
A very simple wrapper enabling us to more easily tell the output stream to style the input word in he...
Definition Hex.h:16