We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 116c939 commit 987cabbCopy full SHA for 987cabb
arrayview.h
@@ -1,6 +1,11 @@
1
#pragma once
2
+
3
+#include <iomanip>
4
/*
5
* like string_view, but takes an iterator-pair.
6
+ *
7
+ * Note that array_view can also take streampos as 'P', and therefore I did not
8
+ * add operator[] and value_type.
9
*/
10
template<typename P>
11
class array_view {
@@ -84,8 +89,9 @@ std::ostream& operator<<(std::ostream&os, const array_view<P>& buf)
84
89
for (const auto& b : buf) {
85
90
os.copyfmt(state);
86
91
if (!first && fillchar) os << fillchar;
87
- os.fill('0');
88
- os.width(2);
92
+ os << std::right;
93
+ os << std::setfill('0');
94
+ os << std::setw(2);
95
os << std::hex << unsigned(b);
96
first= false;
97
}
0 commit comments