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
5
namespace
pflib::packing {
6
15
template
<
typename
WordType, std::
size_t
HexW
id
th = 2 * sizeof(WordType)>
16
struct
hex
{
17
WordType& word_;
18
hex
(WordType& w) : word_{w} {}
19
friend
inline
std::ostream
& operator<<(
20
std::ostream
& os,
const
pflib::packing::hex<WordType, HexWidth>
& h) {
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
std::ostream
std::hex
T hex(T... args)
std::setfill
T setfill(T... args)
std::setw
T setw(T... args)
pflib::packing::hex
A very simple wrapper enabling us to more easily tell the output stream to style the input word in he...
Definition
Hex.h:16
include
pflib
packing
Hex.h
Generated by
1.12.0