Smarter SmartText (not fully working)

This commit is contained in:
NaifBanana
2025-12-12 02:19:45 -06:00
parent c66c4d5574
commit 6a0583b44b
2 changed files with 32 additions and 10 deletions
+6 -1
View File
@@ -23,13 +23,18 @@ const nb::SmartFormatMap TestStream<ST>::Formatters = {
}},
{2, [](std::string msg, std::string fmt){
return "\x1b[1m" + msg + "\x1b[0m";
}},
{3, [](std::string msg, std::string fmt){
return "\x1b[31m" + msg + "\x1b[0m";
}}
};
using nb::SmartText;
int main() {
auto tout = TestStream(std::cout);
tout << nb::SmartText{"Gloop!\n", {2, "32"}};
tout << SmartText<SmartText<const char*>>{SmartText<const char*>{"Gloop\n", {3, ""}}, {2, "32"}};
tout << 8989 << "\n";
return 0;