@@ -1030,7 +1030,7 @@ enum {
1030
1030
pointer_set = set (type::pointer_type)
1031
1031
};
1032
1032
1033
- struct view {};
1033
+ template < typename T> struct is_view : std::false_type {};
1034
1034
1035
1035
template <typename Char, typename T> struct named_arg ;
1036
1036
template <typename T> struct is_named_arg : std::false_type {};
@@ -1039,14 +1039,17 @@ template <typename T> struct is_static_named_arg : std::false_type {};
1039
1039
template <typename Char, typename T>
1040
1040
struct is_named_arg <named_arg<Char, T>> : std::true_type {};
1041
1041
1042
- template <typename Char, typename T> struct named_arg : view {
1042
+ template <typename Char, typename T> struct named_arg {
1043
1043
const Char* name;
1044
1044
const T& value;
1045
1045
1046
1046
named_arg (const Char* n, const T& v) : name(n), value(v) {}
1047
1047
static_assert (!is_named_arg<T>::value, " nested named arguments" );
1048
1048
};
1049
1049
1050
+ template <typename Char, typename T>
1051
+ struct is_view <named_arg<Char, T>> : std::true_type {};
1052
+
1050
1053
template <bool B = false > constexpr auto count () -> int { return B ? 1 : 0 ; }
1051
1054
template <bool B1, bool B2, bool ... Tail> constexpr auto count () -> int {
1052
1055
return (B1 ? 1 : 0 ) + count<B2, Tail...>();
@@ -2715,7 +2718,7 @@ template <typename... T> struct fstring {
2715
2718
template <size_t N>
2716
2719
FMT_CONSTEVAL FMT_ALWAYS_INLINE fstring (const char (&s)[N]) : str(s, N - 1 ) {
2717
2720
using namespace detail ;
2718
- static_assert (count<(std::is_base_of<view, remove_reference_t <T>>::value &&
2721
+ static_assert (count<(is_view< remove_cvref_t <T>>::value &&
2719
2722
std::is_reference<T>::value)...>() == 0 ,
2720
2723
" passing views as lvalues is disallowed" );
2721
2724
if (FMT_USE_CONSTEVAL) parse_format_string<char >(s, checker (s, arg_pack ()));
0 commit comments