pflib v3.0.0-rc1-29-g3a901ac
Pretty Fine HGCROC Interaction Library
All Classes Namespaces Files Functions Variables Typedefs Pages
Hex.h
1#pragma once
2
3#include <iomanip>
4
5namespace pflib::packing {
6
15template <typename WordType>
16struct hex {
17 static const std::size_t width_{2*sizeof(WordType)};
18 WordType& word_;
19 hex(WordType& w) : word_{w} {}
20 friend inline std::ostream& operator<<(
22 os << "0x" << std::setfill('0') << std::setw(h.width_) << std::hex
23 << h.word_ << std::dec;
24 return os;
25 }
26};
27
28} // namespace pflib::packing
29
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