fix: mark fmt::streamed() as constexpr (#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`.
This commit is contained in:
parent
8ef4db4b96
commit
a3a74fa7f3
@ -140,7 +140,7 @@ struct formatter<detail::streamed_view<T>, Char>
|
||||
\endrst
|
||||
*/
|
||||
template <typename T>
|
||||
auto streamed(const T& value) -> detail::streamed_view<T> {
|
||||
constexpr auto streamed(const T& value) -> detail::streamed_view<T> {
|
||||
return {value};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user