// TODO FMT Add a test to validate we fail when using that concept after P2165
// has been implemented.
template <class _Tp>
-concept __fmt_pair_like = __is_specialization_v<_Tp, pair> ||
- // Use a requires since tuple_size_v may fail to instantiate,
- (__is_specialization_v<_Tp, tuple> && requires { tuple_size_v<_Tp> == 2; });
+concept __fmt_pair_like =
+ __is_specialization_v<_Tp, pair> || (__is_specialization_v<_Tp, tuple> && tuple_size_v<_Tp> == 2);
# endif //_LIBCPP_STD_VER >= 23
#endif //_LIBCPP_STD_VER >= 20
check(SV("__(42), (99)___"), SV("{:_^15n}"), input);
// *** type ***
- check(SV("__{(42), (99)}___"), SV("{:_^17m}"), input);
+ check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
check(SV("__(1, 10, 100), (42, 99, 0)___"), SV("{:_^30n}"), input);
// *** type ***
- check(SV("__{(1, 10, 100), (42, 99, 0)}___"), SV("{:_^32m}"), input);
+ check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
check(SV("__(42), (99)___"), SV("{:_^15n}"), input);
// *** type ***
- check(SV("__{(42), (99)}___"), SV("{:_^17m}"), input);
+ check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
check(SV("__(42, 99, 0), (1, 10, 100)___"), SV("{:_^30n}"), input);
// *** type ***
- check(SV("__{(42, 99, 0), (1, 10, 100)}___"), SV("{:_^32m}"), input);
+ check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))