C++ Editor's Report, May 2013
Overview
New Papers
N3690 is the C++14 Committee Draft. N3691 is the latest C++ Working Draft. Other than the front cover, its contents are identical to N3690. Both papers contain the changes listed below.
Acknowledgements
Thank you to Jonathan Wakely for providing git patches to the draft source for nearly all LWG papers.
Thank you to Richard Smith for providing git patches to the draft source
for his paper, N3652, Relaxing constraints on constexpr functions, and to
Jeffrey Yasskin for providing patches for his paper, N3668,
std::exchange
.
Thank you to the editor's committee for reviewing the C++14 Committee Draft. The editor's committee for the C++14 CD consists of: Alisdair Meredith, Daniel Krügler, Richard Smith, and Mike Miller.
Thank you to everyone who provided editorial fixes to the draft. To submit a fix, follow these instructions.
Thank you to my employer, Intel Corporation, for sponsoring my work as project editor.
Working Draft Changes
Statistics
The latest draft adds wording from
64 CWG issues,
11 CWG papers,
36 LWG issues,
14 LWG papers,
5 SG1 issues, and
1 SG1 paper.
CWG Issues Applied
Resolutions from the following CWG issues were applied:
- CWG223 The meaning of deprecation
- CWG496 Is a volatile-qualified type really a POD?
- CWG616 Definition of "indeterminate value"
- CWG1310 What is an "acceptable lookup result?"
- CWG1318 Syntactic ambiguities with final
- CWG1320 Converting scoped enumerations to bool
- CWG1374 Qualification conversion vs difference in reference bindingProposed wording tweaked slightly during application to add a missing "or, if not that," to the now second-to-last bullet. Confirmed as the right thing to do by Mike Miller.
- CWG1405 constexpr and mutable members of literal types
- CWG1328 Conflict in reference binding vs overload resolution
- CWG1330 Delayed instantiation of noexcept specifiersContext in proposed wording did not precisely match the wording as in N3485. Confirmed with Mike Miller that the end state should be "...shall not denote an incomplete type or an rvalue reference type." in the relevant sentence.Added a comma after "e.g." - typo in proposed resolution.
- CWG1411 More on global scope :: in nested-name-specifier
- CWG1412 Problems in specifying pointer conversions
- CWG1413 Missing cases of value-dependency
- CWG1425 Base-class subobjects of standard-layout structs
- CWG1435 template-id as the declarator for a class template constructor
- CWG1437 alignas in alias-declaration
- CWG1442 Argument-dependent lookup in the range-based for
- CWG1456 Address constant expression designating the one-past-the-end address
- CWG1472 odr-use of reference variables
- CWG1475 Errors in [[carries_dependency]] example
- CWG1476 Definition of user-defined type
- CWG1479 Literal operators and default arguments
- CWG1481 Increment/decrement operators with reference parameters
- CWG1489 Is value-initialization of an array constant initialization?
- CWG1495 Partial specialization of variadic class template
- CWG1502 Value initialization of unions with member initializers
- CWG1503 Exceptions during copy to exception object
- CWG1504 Pointer arithmetic after derived-base conversion
- CWG1506 Value category of initializer_list object
- CWG1510 cv-qualified references via decltype
- CWG1511 const volatile variables and the one-definition rule
- CWG1515 Modulo 2^n arithmetic for implicitly-unsigned types
- CWG1516 Definition of "virtual function call"
- CWG1522 Access checking for initializer_list array initialization
- CWG1527 Assignment from braced-init-list
- CWG1528 Repeated cv-qualifiers in declarators
- CWG1532 Explicit instantiation and member templates
- CWG1533 Function pack expansion for member initialization
- CWG1535 typeid in core constant expressions
- CWG1537 Optional compile-time evaluation of constant expressions
- CWG1538 C-style cast in braced-init-list assignment
- CWG1539 Definition of "character type"
- CWG1541 cv void return types
- CWG1543 Implicit conversion sequence for empty initializer listFix transcription problem in proposed wording:
initializer_list
->initializer_list<int>
- CWG1544 Linkage of member of unnamed namespace
- CWG1550 Parenthesized throw-expression operand of conditional-expressionAlso resolves CWG1560.
- CWG1553 sizeof and xvalue bit-fields
- CWG1556 Constructors and explicit conversion functions in direct initialization
- CWG1557 Language linkage of converted lambda function pointer
- CWG1464 Negative array bound in a new-expressionAlso resolves CWG1559.
- CWG1462 Deduction failure vs "ill-formed, no diagnostic required"
- CWG1471 Nested type of non-dependent base
- CWG1473 Syntax of literal-operator-id
- CWG1477 Definition of a friend outside its namespace
- CWG1482 Point of declaration of enumerationAlso resolved CWG977.
- CWG1487 When are inheriting constructors declared?
- CWG1494 Temporary initialization for reference binding in list-initialization
- CWG1507 Value initialization with trivial inaccessible default constructor
- CWG1563 List-initialization and overloaded function disambiguation
- CWG1605 Misleading parenthetical comment for explicit destructor call
- CWG903 Value-dependent integral null pointer constantsMinor tweak to the proposed resolution: in [dcl.init]/5, added "the" to "...obtained by converting *the* integer literal 0 (zero)".
- CWG1213 Array subscripting and xvalues
- CWG1358 Unintentionally ill-formed constexpr function template instancesOctober 2012 Proposed Resolution.
- CWG974 Default arguments for lambdas
CWG Papers Applied
Proposed wording from the following CWG papers was applied:
- N3472 Binary Literals in the C++ Core LanguageAppendix A (grammar summary) also updated.
- N3624 Pointer comparison vs qualification conversionsIn the additions to [expr], terms like T1, C1, etc., were typeset in code font."pointers to member" was replaced by "pointers to members" in accordance with existing practice in the standard.In the new paragraph at the end of [expr], the reference to "expr.qual" was fixed to refer to "conv.qual".operator== and operator!= in body text were changed to "the == operator" and "the != operator" respectively. This makes it clear that we are not talking about overloaded operators here.
- N3639 Runtime-sized arrays with automatic storage durationIn [dcl.array]/1, removed bullet points from the last part of the major bits of added text. The bulleted list was preceded by nothing and appeared out of nowhere.Added an index entry for "array of runtime bound" and "runtime bound, array of".In [support.dynamic], bad_array_length also added to <new> synopsis.Typeset types in comments to [dcl.array]/1 as code, including two existing instances not added by the paper.Improved grammar as follows: "is invoked ... after the lifetime of the array ended" -> "... has ended"Rearranged commas in [dcl.fct]/8 for consistent and correct grammar.
- N3648 Wording Changes for Generalized Lambda-captureGrammar reference updated.
- N3653 Member initializers and aggregates
- N3664 Clarifying Memory Allocation"size parameter" changed to "size argument" in reference to an allocation function.
- N3667 Drafting for Core 1402
- N3651 Variable Templates (Revision 1)The example requested by change set 6 was merged into the existing example for that paragraph.The order of "class/function/variable" was kept consistent in applying change 8 in [temp.inst].I struck "member function" from the added sentence "If the explicit instantiation is for a variable or member function, the unqualified-id in the declaration shall be a template-id." because that case was already covered in the existing text.I reordered the appearance of "variable template" to make it consistent with the rest of the section in a few paragraphs.I formatted "const" in "const variables" as fixed-width.I added a missing "a" to "has constexpr specifier" in the existing text.I changed "template<typename T>" to "template<class T>" for consistency with existing examples in the clause.
- N3638 Return type deduction for normal functionsThe grammar reference was updated.N3638 was based off an earlier draft than N3485. This caused some conflicts in the middle of the [dcl.spec.auto] changes. These were resolved based on feedback from the paper author.Replaced dangling non-normative sentence referring to [dcl.spec.auto] from [dcl.type.simple] with a non-normative note to make the paragraph easier to read.Avoided sentence starting with a conjunction ("But once a return ...") and instead use "..., however, ...".Removed single quotation marks from "instantiates both 'f's".
- N3649 Generic (Polymorphic) Lambda Expressions (Revision 3)Because of conflicts with N3638, I had to change the [dcl.spec.auto] changes quite a bit, and I recommend CWG create an issue to review the merged state.In the example provided (f1, f2, g, h, glambda), it is not clear to me what "ID" refers to in comments like "error: ID is not convertible".Removed code font from "const" and "inline" in sentence usage, e.g. in "For a generic lambda, the closure type has a public inline function". An editorial issue was opened to make this consistent throughout the draft.
- N3652 Relaxing constraints on constexpr functionsConflicts resolved as indicated by N3652.In [class.copy]/26 replaced "copy/move each direct base class" with "copy/move each direct base class subobject" to make wording consistent with other section above, as suggested by CWG chair.
LWG Issues Applied
Resolutions from the following LWG issues were applied:
- LWG2091 Misplaced effect in m.try_lock_for()
- LWG2092 Vague Wording for condition_variable_anyThis change was made in [thread.condition.condvar] as the context and issue description would suggest, rather than [thread.timedmutex.requirements] as the proposed wording indicates (presumably a copy-o from issue 2091).
- LWG2145 error_category default constructor
- LWG2147 Unclear hint type in Allocator's allocate function"possibly const" formatted with "const" in code font, since that is the prevalent (though not uniform) style in the draft.
- LWG2163 nth_element requires inconsistent post-conditions
- LWG2169 Missing reset() requirements in unique_ptr specialization
- LWG2172 Does atomic_compare_exchange_* accept v == nullptr arguments?
- LWG2080 Specify when once_flag becomes invalid
- LWG2144 Missing noexcept specification in type_index
- LWG2174 wstring_convert::converted() should be noexcept
- LWG2175 wstring_convert and wbuffer_convert validityImproved the grammar of the first added sentence with a comma.
- LWG2177 Requirements on Copy/MoveInsertableI rephrased the new wording for grammar and clarity. Specifically, I replaced "when evaluated the following postconditions hold" with "its evaluation causes the following postcondition to hold" and I changed "satisfying the MoveInsertable requirements" to "T being MoveInsertable into X".
- LWG2187 vector
is missing emplace and emplace_back member functions - LWG2197 Specification of is_[un]signed unclear for non-arithmetic types
- LWG2200 Data race avoidance for all containers, not only for sequences
- LWG2211 Replace ambiguous use of "Allocator" in container requirements
- LWG2222 Inconsistency in description of forward_list::splice_after single-element overload
- LWG2225 Unrealistic header inclusion checks required
- LWG2231 DR 704 removes complexity guarantee for clear()General issues with this table logged at https://github.com/cplusplus/draft/issues/120
- LWG2209 assign() overspecified for sequence containers
- LWG2109 Incorrect requirements for hash specializations
- LWG2093 Throws clause of condition_variable::wait with predicateI edited the first sentence of the new paragraph in [thread.req.timing] for improved grammar and clarity.I introduced the term "timeout-related exceptions" to make it clear what is referred to by that phrase later on.I dropped "any" from "any timeout-related exceptions" in some of the Throws clauses modified to by the proposed wording to be consistent with the other Throws clauses.
- LWG2094 duration conversion overflow shouldn't participate in overload resolution
- LWG2148 Hashing enums should be supported directly by std::hash
- LWG2149 Concerns about 20.8/5
- LWG2162 allocator_traits::max_size missing noexcept
- LWG2176 Special members for wstring_convert and wbuffer_convert
- LWG2207 basic_string::at should not have a Requires clause
- LWG2229 Standard code conversion facets underspecified
- LWG2235 Undefined behavior without proper requirements on basic_string constructors
- LWG2128 Absence of global functions cbegin/cend
- LWG2203 scoped_allocator_adaptor uses wrong argument types for piecewise construction
- LWG2122 merge() stability for lists versus forward lists
- LWG2196 Specification of is_*[copy/move]_[constructible/assignable] unclear for non-referencable types
- LWG2210 Missing allocator-extended constructor for allocator-aware containers
- LWG2098 Minor Inconsistency between promise::set_value and promise::set_value_at_thread_exit
LWG Papers Applied
Proposed wording from the following LWG papers was applied:
- N3668 exchange() utility function, revision 3
- N3545 An Incremental Improvement to integral_constant
- N3644 Null Forward Iterators
- N3658 Compile-time integer sequencesIncludes editorial change to simplify example with return type deduction (as discussed by LWG) as allowed by N3638.Updated the overview table in [utilities.general].
- N3670 Wording for Addressing Tuples by Type: Revision 2
- N3671 Making non-modifying sequence operations more robust: Revision 2
- N3656 make_unique (Revision 1)The new overloads were also added to the
synopsis. Whitespace was tweaked to match the surrounding text. - N3654 Quoted Strings Library Proposal (Revision 2)
- N3642 User-defined Literals for Standard Library Types (part 1 - version 4)Re-ordered the basic_string literals so they are listed in the order char, char16_t, char32_t and wchar_t. This matches the other functions in Clause 21.Changed const char *str to const char* str for consistency with asterisk placement in basic_string itself.Changed operator"" to operator "" for consistency with core wording.Added whitespace to duration literal declarations so they are alignedChanged section title to "Suffixes for duration literals" instead of "Suffix for duration literals"Use string, u16string etc. typedefs for basic_string
- N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)
- N3672 A proposal to add a utility class to represent optional objects (Revision 4)Updated the overview table in [utilities.general].Placed after compile-time integer sequences.Reorganized [optional.defs]/1 as an itemized list.Reworded [optional.object]/2.Reworded [optional.object.ctor]/2.Added constexpr specifier to constructor declarations to match synopsis and Remarks.Corrected [optional.object.observe]/18 to depend on both constructors.Capitalized first letter of Remarks for operator bool().
- N3669 Fixing constexpr member functions without const
- N3662 C++ Dynamic ArraysPlaced between deque and forward_list, as opposed to at the very end of [sequences].Removed Allocator template parameter from comparison operators.Used 'template <class T>' instead of 'template< typename T >'.Declared member types public.Referred to 23.2 for implementation-defined iterator types.Added 'explicit' keyword to first declaration in [dynarray.cons].
- N3655 TransformationTraits Redux, v2Section 4 of the proposal was not applied, as per the LWG motion.The added text was interspersed with the corresponding groups of type declarations.
SG1 Issues Applied
Resolutions from the following SG1 (Concurrency) issues were applied:
- LWG2130 Missing ordering constraints
- LWG2138 atomic_flag::clear should not accept memory_order_consume
- LWG2140 Meaning of notify_all_at_thread_exit synchronization requirement?
- LWG2190 Condition variable specification
- LWG2185 Missing throws clause for future/shared_future::wait_for/wait_until
SG1 Papers Applied
Proposed wording from the following SG1 (Concurrency) papers was applied:
- N3659 Shared locking in C++, Revision 2
Minor editorial changes
For a full list of editorial changes, please see the C++ draft repository on GitHub.