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 8e009e8 commit 17f3171Copy full SHA for 17f3171
src/Utils/Logger.hpp
@@ -90,7 +90,11 @@ class Logger {
90
std::stringstream strm;
91
strm << log_lvl << ": ";
92
(strm << ... << std::forward<ARGS>(args)) << '\n';
93
- std::string str = strm.str();
+ /*
94
+ * std::move is required to eliminate copying from
95
+ * std::stringstream if complied with C++20 or higher.
96
+ */
97
+ std::string str = std::move(strm).str();
98
ssize_t rc = write(fd, std::data(str), std::size(str));
99
(void)rc;
100
}
0 commit comments