Add string_stream pipe modifiers
This commit is contained in:
parent
198f3d3f72
commit
8499b101e3
14
include/mtl/stream.cpp
Normal file
14
include/mtl/stream.cpp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#include "mtl/stream.hpp"
|
||||||
|
|
||||||
|
namespace mtl {
|
||||||
|
|
||||||
|
_endl endl;
|
||||||
|
_flush flush;
|
||||||
|
|
||||||
|
_dec dec;
|
||||||
|
_hex hex;
|
||||||
|
|
||||||
|
_left left;
|
||||||
|
_right right;
|
||||||
|
|
||||||
|
} // namespace mtl
|
||||||
20
include/mtl/stream.hpp
Normal file
20
include/mtl/stream.hpp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
|
namespace mtl {
|
||||||
|
|
||||||
|
extern struct _endl { } endl;
|
||||||
|
extern struct _flush { } flush;
|
||||||
|
|
||||||
|
extern struct _dec { } dec;
|
||||||
|
extern struct _hex { } hex;
|
||||||
|
|
||||||
|
extern struct _left { } left;
|
||||||
|
extern struct _right { } right;
|
||||||
|
struct setw {
|
||||||
|
size_t m_w;
|
||||||
|
setw(size_t w) : m_w(w) { }
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace mtl
|
||||||
Loading…
x
Reference in New Issue
Block a user