|
15442 | 15442 | If \tcode{\{ \opt{\fmtgrammarterm{arg-id}} \}} is used in
|
15443 | 15443 | a \fmtgrammarterm{width} or \fmtgrammarterm{precision} option,
|
15444 | 15444 | the value of the corresponding formatting argument is used as the value of the option.
|
15445 |
| -If the corresponding formatting argument is |
15446 |
| -not of standard signed or unsigned integer type, or |
15447 |
| -its value is negative, |
| 15445 | +The option is valid only if the corresponding formatting argument is |
| 15446 | +of standard signed or unsigned integer type. |
| 15447 | +If its value is negative, |
15448 | 15448 | an exception of type \tcode{format_error} is thrown.
|
15449 | 15449 |
|
15450 | 15450 | \pnum
|
|
16555 | 16555 | size_t num_args_; // \expos
|
16556 | 16556 |
|
16557 | 16557 | public:
|
16558 |
| - constexpr explicit basic_format_parse_context(basic_string_view<charT> fmt, |
16559 |
| - size_t num_args = 0) noexcept; |
| 16558 | + constexpr explicit basic_format_parse_context(basic_string_view<charT> fmt) noexcept; |
16560 | 16559 | basic_format_parse_context(const basic_format_parse_context&) = delete;
|
16561 | 16560 | basic_format_parse_context& operator=(const basic_format_parse_context&) = delete;
|
16562 | 16561 |
|
|
16566 | 16565 |
|
16567 | 16566 | constexpr size_t next_arg_id();
|
16568 | 16567 | constexpr void check_arg_id(size_t id);
|
| 16568 | + |
| 16569 | + template<class... Ts> |
| 16570 | + constexpr void check_dynamic_spec(size_t id) noexcept; |
| 16571 | + constexpr void check_dynamic_spec_integral(size_t id) noexcept; |
| 16572 | + constexpr void check_dynamic_spec_string(size_t id) noexcept; |
16569 | 16573 | };
|
16570 | 16574 | }
|
16571 | 16575 | \end{codeblock}
|
|
16578 | 16582 |
|
16579 | 16583 | \indexlibraryctor{basic_format_parse_context}%
|
16580 | 16584 | \begin{itemdecl}
|
16581 |
| -constexpr explicit basic_format_parse_context(basic_string_view<charT> fmt, |
16582 |
| - size_t num_args = 0) noexcept; |
| 16585 | +constexpr explicit basic_format_parse_context(basic_string_view<charT> fmt) noexcept; |
16583 | 16586 | \end{itemdecl}
|
16584 | 16587 |
|
16585 | 16588 | \begin{itemdescr}
|
|
16590 | 16593 | \tcode{end_} with \tcode{fmt.end()},
|
16591 | 16594 | \tcode{indexing_} with \tcode{unknown},
|
16592 | 16595 | \tcode{next_arg_id_} with \tcode{0}, and
|
16593 |
| -\tcode{num_args_} with \tcode{num_args}. |
| 16596 | +\tcode{num_args_} with \tcode{0}. |
| 16597 | +\begin{note} |
| 16598 | +Any call to |
| 16599 | +\tcode{next_arg_id}, \tcode{check_arg_id}, or \tcode{check_dynamic_spec} |
| 16600 | +on an instance of \tcode{basic_format_parse_context} |
| 16601 | +initialized using this constructor is not a core constant expression. |
| 16602 | +\end{note} |
16594 | 16603 | \end{itemdescr}
|
16595 | 16604 |
|
16596 | 16605 | \indexlibrarymember{begin}{basic_format_parse_context}%
|
|
16683 | 16692 | core constant expressions\iref{expr.const}.
|
16684 | 16693 | \end{itemdescr}
|
16685 | 16694 |
|
| 16695 | +\indexlibrarymember{check_dynamic_spec}{basic_format_parse_context}% |
| 16696 | +\begin{itemdecl} |
| 16697 | +template<class... Ts> |
| 16698 | + constexpr void check_dynamic_spec(size_t id) noexcept; |
| 16699 | +\end{itemdecl} |
| 16700 | + |
| 16701 | +\begin{itemdescr} |
| 16702 | +\pnum |
| 16703 | +\mandates |
| 16704 | +The types in \tcode{Ts...} are unique. |
| 16705 | +Each type in \tcode{Ts...} is one of |
| 16706 | +\keyword{bool}, |
| 16707 | +\tcode{char_type}, |
| 16708 | +\keyword{int}, |
| 16709 | +\tcode{\keyword{unsigned} \keyword{int}}, |
| 16710 | +\tcode{\keyword{long} \keyword{long} \keyword{int}}, |
| 16711 | +\tcode{\keyword{unsigned} \keyword{long} \keyword{long} \keyword{int}}, |
| 16712 | +\keyword{float}, |
| 16713 | +\keyword{double}, |
| 16714 | +\tcode{\keyword{long} \keyword{double}}, |
| 16715 | +\tcode{\keyword{const} char_type*}, |
| 16716 | +\tcode{basic_string_view<char_type>}, or |
| 16717 | +\tcode{\keyword{const} \keyword{void}*}. |
| 16718 | + |
| 16719 | +\pnum |
| 16720 | +\remarks |
| 16721 | +Call expressions where |
| 16722 | +\tcode{id >= num_args_} or |
| 16723 | +the type of the corresponding format argument |
| 16724 | +(after conversion to \tcode{basic_format_arg<Context>}) |
| 16725 | +is not one of the types in \tcode{Ts...} |
| 16726 | +are not core constant expressions\iref{expr.const}. |
| 16727 | +\end{itemdescr} |
| 16728 | + |
| 16729 | +\indexlibrarymember{check_dynamic_spec_integral}{basic_format_parse_context}% |
| 16730 | +\begin{itemdecl} |
| 16731 | +constexpr void check_dynamic_spec_integral(size_t id) noexcept; |
| 16732 | +\end{itemdecl} |
| 16733 | + |
| 16734 | +\begin{itemdescr} |
| 16735 | +\pnum |
| 16736 | +\effects |
| 16737 | +Equivalent to: |
| 16738 | +\begin{codeblock} |
| 16739 | +check_dynamic_spec<int, unsigned int, long long int, unsigned long long int>(id); |
| 16740 | +\end{codeblock} |
| 16741 | +\end{itemdescr} |
| 16742 | + |
| 16743 | +\indexlibrarymember{check_dynamic_spec_string}{basic_format_parse_context}% |
| 16744 | +\begin{itemdecl} |
| 16745 | +constexpr void check_dynamic_spec_string(size_t id) noexcept; |
| 16746 | +\end{itemdecl} |
| 16747 | + |
| 16748 | +\begin{itemdescr} |
| 16749 | +\pnum |
| 16750 | +\effects |
| 16751 | +Equivalent to: |
| 16752 | +\begin{codeblock} |
| 16753 | +check_dynamic_spec<const char_type*, basic_string_view<char_type>>(id); |
| 16754 | +\end{codeblock} |
| 16755 | +\end{itemdescr} |
| 16756 | + |
16686 | 16757 | \rSec3[format.context]{Class template \tcode{basic_format_context}}
|
16687 | 16758 |
|
16688 | 16759 | \indexlibraryglobal{basic_format_context}%
|
|
0 commit comments