Skip to content
forked from fmtlib/fmt

Commit ee4beb1

Browse files
muggenhorckerr
authored andcommitted
fix: mark fmt::streamed() as constexpr (fmtlib#3650)
Because it's just performing a very basic type conversion that can be done at constexpr time. My use case simultaneously creates a `fmt::basic_format_string<some_type_conversion<Args...>>` instance and performs `some_type_conversion<Args>(args)...`. `some_type_conversion` optionally applies `fmt::streamed(arg)` to a subset of types. This needs to be `constexpr` because `basic_format_string`'s constructor is `consteval`.
1 parent 9fa0a86 commit ee4beb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/fmt/ostream.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ struct formatter<detail::streamed_view<T>, Char>
140140
\endrst
141141
*/
142142
template <typename T>
143-
auto streamed(const T& value) -> detail::streamed_view<T> {
143+
constexpr auto streamed(const T& value) -> detail::streamed_view<T> {
144144
return {value};
145145
}
146146

0 commit comments

Comments
 (0)