Title
basic_format_context::arg(size_t) should be noexcept
Status
c++23
Section
[format.context]
Submitter
Hewill Kang

Created on 2021-12-26.00:00:00 last changed 4 months ago

Messages

Date: 2022-02-10.12:58:57

Proposed resolution:

This wording is relative to N4901.

  1. Modify [format.context] as indicated:

    namespace std {
      template<class Out, class charT>
      class basic_format_context {
        basic_format_args<basic_format_context> args_; // exposition only
        Out out_; // exposition only
      public:
        using iterator = Out;
        using char_type = charT;
        template<class T> using formatter_type = formatter<T, charT>;
        
        basic_format_arg<basic_format_context> arg(size_t id) const noexcept;
        std::locale locale();
    
        iterator out();
        void advance_to(iterator it);
      };
    }
    

    […]

    basic_format_arg<basic_format_context> arg(size_t id) const noexcept;
    

    -5- Returns: args_.get(id).

Date: 2022-02-10.00:00:00

[ 2022-02-10 Approved at February 2022 virtual plenary. Status changed: Tentatively Ready → WP. ]

Date: 2022-01-15.00:00:00

[ 2022-01-30; Reflector poll ]

Set status to Tentatively Ready after six votes in favour during reflector poll.

Date: 2021-12-26.00:00:00

basic_format_context::arg(size_t) simply returns args_.get(id) to get the elements of args_, where the type of args_ is basic_format_args<basic_format_context>. Since basic_format_args's get(size_t) is noexcept, this function can also be noexcept.

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2022-02-10 12:58:57adminsetmessages: + msg12362
2022-02-10 12:58:57adminsetstatus: ready -> wp
2022-01-30 17:01:07adminsetmessages: + msg12307
2022-01-30 17:01:07adminsetstatus: new -> ready
2022-01-15 13:40:22adminsetmessages: + msg12259
2021-12-26 00:00:00admincreate