We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54f025c commit 60bac19Copy full SHA for 60bac19
doc/example_usage.md
@@ -0,0 +1,32 @@
1
+
2
+# An {fmt} wrapper around OutputDebugString makes sending formatted message much more plesant.
3
+```
4
+#include <fmt/format.h>
5
6
+#include <sstream>
7
+#include <string_view>
8
9
+void OutputDebugString(const char * message)
10
+{
11
+ fmt::print("{}", message);
12
+}
13
14
+void DebugMessage(std::string_view message)
15
16
+ OutputDebugString(message.data());
17
18
19
+template <typename... Args>
20
+void DebugMessage(std::string_view format, Args &&... args)
21
22
+ auto formatted = fmt::vformat(format, fmt::make_args_checked<Args...>(format, std::forward<Args>(args)...));
23
+ OutputDebugString(formatted.data());
24
25
26
+int main()
27
28
+ DebugMessage("test");
29
+ DebugMessage("[{}]", 42);
30
+ return 0;
31
32
0 commit comments