#include #include "SmartStreams.hpp" template class TestStream : public nb::SmartOStream> { using Base = nb::SmartOStream>; public: TestStream(ST& stream) : Base(stream) {} static const nb::SmartFormatMap Formatters; protected: }; template const nb::SmartFormatMap TestStream::Formatters = { {0, [](std::string msg, std::string fmt){ return "[0] : " + msg; }}, {1, [](std::string msg, std::string fmt){ return "\x1b[" + fmt + "m" + msg + "\x1b[0m"; }}, {2, [](std::string msg, std::string fmt){ return "\x1b[1m" + msg + "\x1b[0m"; }} }; int main() { auto tout = TestStream(std::cout); tout << nb::SmartText{"Gloop!\n", {2, "32"}}; tout << 8989 << "\n"; return 0; }