Title
Specializations of basic_format_context should not be permitted
Status
new
Section
[format.context]
Submitter
Brian Bi

Created on 2023-08-13.00:00:00 last changed 4 days ago

Messages

Date: 2023-09-17.08:39:58

Proposed resolution:

This wording is relative to N4958.

  1. Modify the [format.context] as indicated:

    -1- An instance of basic_format_context holds formatting state consisting of the formatting arguments and the output iterator.

    -?- The behavior of a program that adds specializations of basic_format_context is undefined.

    -2- Out shall model output_iterator<const charT&>.

Date: 2023-08-13.00:00:00

The current wording allows users to specialize std::basic_format_context. However, an implementation is not likely to accept a program that uses the library in a way that would instantiate such a specialization, because [format.context] does not provide a complete description of the interface that such a specialization would need to have (e.g., it does not provide a means to initialize the exposition-only args_ member). Since the library was not designed to be able to work with user specializations of std::basic_format_context, declaring such specializations should be explicitly disallowed.

History
Date User Action Args
2023-09-17 08:39:58adminsetmessages: + msg13718
2023-08-13 00:00:00admincreate