Add string_stream pipe modifiers

This commit is contained in:
Myles Busig 2024-03-25 21:17:03 -06:00
parent 45cdce1135
commit efd61da7d0
2 changed files with 34 additions and 0 deletions

14
include/mtl/stream.cpp Normal file
View 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
View 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