Open
Description
There're Preconditions specified in [format.arg]/5 for constructing a basic_format_arg
:
Preconditions: If
decay_t<T>
ischar_type*
orconst char_type*
,static_cast<const char_type*>(v)
points to a NTCTS ([defns.ntcts]).
And character arrays are decayed per [format.arg]/6.9:
otherwise, if
decay_t<TD>
ischar_type*
orconst char_type*
, initializes value withstatic_cast<const char_type*>(v)
;
It seems that we can check the content of the array (of known bound) in this internal factory function.
STL/stl/inc/__msvc_ranges_tuple_formatter.hpp
Lines 277 to 293 in 44a276f
Should we verify that the array is null-terminated? Note that the checking is not O(1) but still seems cheap in formatting to me.