Skip to content

Commit 20c4185

Browse files
committed
fix: 修复日志输出类型错误
1 parent 5d09ee6 commit 20c4185

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/include/Utils/LoggerUtils.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -94,23 +94,23 @@ class StringConverter
9494
}
9595

9696
template <typename T>
97-
std::string operator()(std::optional<T>&& value) const
97+
std::string operator()(const std::optional<T>& value) const
9898
{
9999
if (!value) {
100100
return nullptr;
101101
}
102-
return this->operator()(std::forward<T>(*value));
102+
return this->operator()(*value);
103103
}
104104

105105
template <typename T>
106106
requires has_output_operator<T>
107-
std::string operator()(T&& value) const
107+
std::string operator()(const T& value) const
108108
{
109109
std::stringstream ss;
110110
if constexpr (std::same_as<bool, std::decay_t<T>>) {
111111
ss << std::boolalpha;
112112
}
113-
ss << std::forward<T>(value);
113+
ss << value;
114114
return std::move(ss).str();
115115
}
116116

0 commit comments

Comments
 (0)