digestpp 1.0
C++11 header-only message digest library
Loading...
Searching...
No Matches
stream_width_fixer.hpp
Go to the documentation of this file.
1/*
2This code is written by kerukuro and released into public domain.
3*/
4
5#ifndef DIGESTPP_DETAIL_WIDTH_FIXER_HPP
6#define DIGESTPP_DETAIL_WIDTH_FIXER_HPP
7
8namespace digestpp
9{
10namespace detail
11{
12
13template<typename T, size_t N>
15{
16 stream_width_fixer(T value) : v(value) {}
17 T v;
18};
19
20template<typename T, size_t N>
21std::ostream& operator<<(std::ostream& ostr, const stream_width_fixer<T, N>& value)
22{
23 return ostr << std::setw(N) << value.v;
24}
25
26
27} // namespace detail
28} // namespace digestpp
29
30#endif // DIGESTPP_DETAIL_WIDTH_FIXER_HPP
std::ostream & operator<<(std::ostream &ostr, const stream_width_fixer< T, N > &value)
Definition stream_width_fixer.hpp:21
digestpp namespace
Definition ascon.hpp:14
Definition stream_width_fixer.hpp:15
stream_width_fixer(T value)
Definition stream_width_fixer.hpp:16
T v
Definition stream_width_fixer.hpp:17