mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-08 02:28:15 +00:00
Get rid of basic_prepared_format
This commit is contained in:
parent
4ce006fb6e
commit
006c2546f2
@ -417,31 +417,26 @@ struct compiletime_parts_provider {
|
|||||||
return prepared_parts;
|
return prepared_parts;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Format, typename PreparedPartsContainer, typename... Args>
|
|
||||||
using basic_prepared_format = internal::prepared_format<
|
|
||||||
Format,
|
|
||||||
conditional_t<is_compile_string<Format>::value,
|
|
||||||
compiletime_parts_provider<
|
|
||||||
Format, typename compiletime_prepared_parts_type_provider<
|
|
||||||
Format>::type>,
|
|
||||||
runtime_parts_provider<PreparedPartsContainer>>,
|
|
||||||
Args...>;
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
|
||||||
#if FMT_USE_CONSTEXPR
|
#if FMT_USE_CONSTEXPR
|
||||||
template <typename... Args, typename S,
|
template <typename... Args, typename S,
|
||||||
FMT_ENABLE_IF(is_compile_string<S>::value)>
|
FMT_ENABLE_IF(is_compile_string<S>::value)>
|
||||||
FMT_CONSTEXPR auto compile(S format_str) {
|
FMT_CONSTEXPR auto compile(S format_str) -> internal::prepared_format<
|
||||||
return internal::basic_prepared_format<S, void, Args...>(format_str);
|
S,
|
||||||
|
internal::compiletime_parts_provider<
|
||||||
|
S,
|
||||||
|
typename internal::compiletime_prepared_parts_type_provider<S>::type>,
|
||||||
|
Args...> {
|
||||||
|
return format_str;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <typename... Args, typename Char, size_t N>
|
template <typename... Args, typename Char, size_t N>
|
||||||
auto compile(const Char (&format_str)[N])
|
auto compile(const Char (&format_str)[N]) -> internal::prepared_format<
|
||||||
-> internal::basic_prepared_format<std::basic_string<Char>,
|
std::basic_string<Char>,
|
||||||
std::vector<internal::format_part<Char>>,
|
internal::runtime_parts_provider<std::vector<internal::format_part<Char>>>,
|
||||||
Args...> {
|
Args...> {
|
||||||
return std::basic_string<Char>(format_str, N - 1);
|
return std::basic_string<Char>(format_str, N - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user