|
15065 | 15065 | If \tcode{\{ \opt{\fmtgrammarterm{arg-id}} \}} is used in
|
15066 | 15066 | a \fmtgrammarterm{width} or \fmtgrammarterm{precision} option,
|
15067 | 15067 | the value of the corresponding formatting argument is used as the value of the option.
|
15068 |
| -If the corresponding formatting argument is |
15069 |
| -not of standard signed or unsigned integer type, or |
15070 |
| -its value is negative, |
| 15068 | +The option is valid only if the corresponding formatting argument is |
| 15069 | +of standard signed or unsigned integer type. |
| 15070 | +If its value is negative, |
15071 | 15071 | an exception of type \tcode{format_error} is thrown.
|
15072 | 15072 |
|
15073 | 15073 | \pnum
|
|
16173 | 16173 | size_t num_args_; // \expos
|
16174 | 16174 |
|
16175 | 16175 | public:
|
16176 |
| - constexpr explicit basic_format_parse_context(basic_string_view<charT> fmt, |
16177 |
| - size_t num_args = 0) noexcept; |
| 16176 | + constexpr explicit basic_format_parse_context(basic_string_view<charT> fmt) noexcept; |
16178 | 16177 | basic_format_parse_context(const basic_format_parse_context&) = delete;
|
16179 | 16178 | basic_format_parse_context& operator=(const basic_format_parse_context&) = delete;
|
16180 | 16179 |
|
|
16184 | 16183 |
|
16185 | 16184 | constexpr size_t next_arg_id();
|
16186 | 16185 | constexpr void check_arg_id(size_t id);
|
| 16186 | + |
| 16187 | + template<class... Ts> |
| 16188 | + constexpr void check_dynamic_spec(size_t id) noexcept; |
| 16189 | + constexpr void check_dynamic_spec_integral(size_t id) noexcept; |
| 16190 | + constexpr void check_dynamic_spec_string(size_t id) noexcept; |
16187 | 16191 | };
|
16188 | 16192 | }
|
16189 | 16193 | \end{codeblock}
|
|
16196 | 16200 |
|
16197 | 16201 | \indexlibraryctor{basic_format_parse_context}%
|
16198 | 16202 | \begin{itemdecl}
|
16199 |
| -constexpr explicit basic_format_parse_context(basic_string_view<charT> fmt, |
16200 |
| - size_t num_args = 0) noexcept; |
| 16203 | +constexpr explicit basic_format_parse_context(basic_string_view<charT> fmt) noexcept; |
16201 | 16204 | \end{itemdecl}
|
16202 | 16205 |
|
16203 | 16206 | \begin{itemdescr}
|
|
16208 | 16211 | \tcode{end_} with \tcode{fmt.end()},
|
16209 | 16212 | \tcode{indexing_} with \tcode{unknown},
|
16210 | 16213 | \tcode{next_arg_id_} with \tcode{0}, and
|
16211 |
| -\tcode{num_args_} with \tcode{num_args}. |
| 16214 | +\tcode{num_args_} with \tcode{0}. |
| 16215 | +\begin{note} |
| 16216 | +Any call to |
| 16217 | +\tcode{next_arg_id}, \tcode{check_arg_id}, or \tcode{check_dynamic_spec} |
| 16218 | +on an instance of \tcode{basic_format_parse_context} |
| 16219 | +initialized using this constructor is not a core constant expression. |
| 16220 | +\end{note} |
16212 | 16221 | \end{itemdescr}
|
16213 | 16222 |
|
16214 | 16223 | \indexlibrarymember{begin}{basic_format_parse_context}%
|
|
16301 | 16310 | core constant expressions\iref{expr.const}.
|
16302 | 16311 | \end{itemdescr}
|
16303 | 16312 |
|
| 16313 | +\indexlibrarymember{check_dynamic_spec}{basic_format_parse_context}% |
| 16314 | +\begin{itemdecl} |
| 16315 | +template<class... Ts> |
| 16316 | + constexpr void check_dynamic_spec(size_t id) noexcept; |
| 16317 | +\end{itemdecl} |
| 16318 | + |
| 16319 | +\begin{itemdescr} |
| 16320 | +\pnum |
| 16321 | +\mandates |
| 16322 | +The types in \tcode{Ts...} are unique. |
| 16323 | +Each type in \tcode{Ts...} is one of |
| 16324 | +\keyword{bool}, |
| 16325 | +\tcode{char_type}, |
| 16326 | +\keyword{int}, |
| 16327 | +\keyword{unsigned} \keyword{int}, |
| 16328 | +\keyword{long} \keyword{long} \keyword{int}, |
| 16329 | +\keyword{unsigned} \keyword{long} \keyword{long} \keyword{int}, |
| 16330 | +\keyword{float}, |
| 16331 | +\keyword{double}, |
| 16332 | +\keyword{long} \keyword{double}, |
| 16333 | +\tcode{\keyword{const} char_type*}, |
| 16334 | +\tcode{basic_string_view<char_type>}, or |
| 16335 | +\tcode{\keyword{const} \keyword{void}*}. |
| 16336 | + |
| 16337 | +\pnum |
| 16338 | +\remarks |
| 16339 | +Call expressions where |
| 16340 | +\tcode{id >= num_args_} or |
| 16341 | +the type of the corresponding format argument |
| 16342 | +(after conversion to \tcode{basic_format_arg<Context>}) |
| 16343 | +is not one of the types in \tcode{Ts...} |
| 16344 | +are not core constant expressions\iref{expr.const}. |
| 16345 | +\end{itemdescr} |
| 16346 | + |
| 16347 | +\indexlibrarymember{check_dynamic_spec}{basic_format_parse_context}% |
| 16348 | +\begin{itemdecl} |
| 16349 | +constexpr void check_dynamic_spec_integral(size_t id) noexcept; |
| 16350 | +\end{itemdecl} |
| 16351 | + |
| 16352 | +\begin{itemdescr} |
| 16353 | +\pnum |
| 16354 | +\effects |
| 16355 | +Equivalent to: |
| 16356 | +\begin{codeblock} |
| 16357 | +check_dynamic_spec<int, unsigned int, long long int, unsigned long long int>(id); |
| 16358 | +\end{codeblock} |
| 16359 | +\end{itemdescr} |
| 16360 | + |
| 16361 | +\indexlibrarymember{check_dynamic_spec}{basic_format_parse_context}% |
| 16362 | +\begin{itemdecl} |
| 16363 | +constexpr void check_dynamic_spec_string(size_t id) noexcept; |
| 16364 | +\end{itemdecl} |
| 16365 | + |
| 16366 | +\begin{itemdescr} |
| 16367 | +\pnum |
| 16368 | +\effects |
| 16369 | +Equivalent to: |
| 16370 | +\begin{codeblock} |
| 16371 | +check_dynamic_spec<const char_type*, basic_string_view<char_type>>(id); |
| 16372 | +\end{codeblock} |
| 16373 | +\end{itemdescr} |
| 16374 | + |
16304 | 16375 | \rSec3[format.context]{Class template \tcode{basic_format_context}}
|
16305 | 16376 |
|
16306 | 16377 | \indexlibraryglobal{basic_format_context}%
|
|
0 commit comments