@@ -78,16 +78,6 @@ class LLVM_ABI format_object_base {
78
78
// / printed, this synthesizes the string into a temporary buffer provided and
79
79
// / returns whether or not it is big enough.
80
80
81
- // Helper to validate that format() parameters are scalars or pointers.
82
- template <typename ... Args> struct validate_format_parameters ;
83
- template <typename Arg, typename ... Args>
84
- struct validate_format_parameters <Arg, Args...> {
85
- static_assert (std::is_scalar_v<Arg>,
86
- " format can't be used with non fundamental / non pointer type" );
87
- validate_format_parameters () { validate_format_parameters<Args...>(); }
88
- };
89
- template <> struct validate_format_parameters <> {};
90
-
91
81
template <typename ... Ts>
92
82
class format_object final : public format_object_base {
93
83
std::tuple<Ts...> Vals;
@@ -105,7 +95,9 @@ class format_object final : public format_object_base {
105
95
public:
106
96
format_object (const char *fmt, const Ts &... vals)
107
97
: format_object_base(fmt), Vals(vals...) {
108
- validate_format_parameters<Ts...>();
98
+ static_assert (
99
+ (std::is_scalar_v<Ts> && ...),
100
+ " format can't be used with non fundamental / non pointer type" );
109
101
}
110
102
111
103
int snprint (char *Buffer, unsigned BufferSize) const override {
0 commit comments