mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-08 12:20:06 +00:00
Make is_formattable work with void
This commit is contained in:
parent
b4aea98b55
commit
3df47a4677
@ -2810,8 +2810,11 @@ template <typename Char, typename... T> class fstring {
|
||||
template <typename... T> using format_string = typename fstring<char, T...>::t;
|
||||
|
||||
template <typename T, typename Char = char>
|
||||
using is_formattable = bool_constant<
|
||||
!std::is_base_of<detail::unformattable, detail::mapped_t<T, Char>>::value>;
|
||||
using is_formattable = bool_constant<!std::is_base_of<
|
||||
detail::unformattable,
|
||||
detail::mapped_t<
|
||||
conditional_t<std::is_same<T, void>::value, detail::unformattable, T>,
|
||||
Char>>::value>;
|
||||
|
||||
#ifdef __cpp_concepts
|
||||
template <typename T, typename Char = char>
|
||||
|
@ -624,6 +624,7 @@ FMT_END_NAMESPACE
|
||||
enum class unformattable_scoped_enum {};
|
||||
|
||||
TEST(base_test, is_formattable) {
|
||||
EXPECT_FALSE(fmt::is_formattable<void>::value);
|
||||
EXPECT_FALSE(fmt::is_formattable<wchar_t>::value);
|
||||
#ifdef __cpp_char8_t
|
||||
EXPECT_FALSE(fmt::is_formattable<char8_t>::value);
|
||||
|
Loading…
Reference in New Issue
Block a user