r/cpp • u/STL MSVC STL Dev • Oct 25 '15
C++17 progress update! (Oct 2015)
The C++ Standardization Committee has finished another meeting! This was in Kona, Hawaii, at the same location as the first meeting I attended (in Feb 2012). I thought you'd like a writeup of all the stuff that just got voted in. Like last time, some of these papers are not yet publicly available. What happens during a meeting is that paper authors are furiously revising their work, in response to reviews. After the meeting, the revised papers are collected and published (after a couple of weeks). The Committee has changed their paper numbering system, so finding earlier revisions of papers is super easy. The pre-Kona mailing is available.
I've collected and organized the following information from the official vote, without a whole bunch of editorializing. If you want to know what's in a paper or issue, read it. (I actually do know what's going on with most C++17 Library papers/issues, but writing them all up would take a while.)
C++17 Core Papers
P0001R1 Remove Deprecated Use of the register Keyword
P0002R1 Remove Deprecated operator++(bool)
P0012R1 Make exception specifications be part of the type system, version 5
P0061R1 __has_include for C++17
P0134R0 Introducing a name for brace-or-equal-initializers for non-static data members
P0136R1 Rewording inheriting constructors (core issue 1941 et al)
P0160R0 Wording for removing defaults for unary folds
C++17 Library Papers
P0004R1 Remove Deprecated iostreams aliases
P0006R0 Adopt Type Traits Variable Templates from Library Fundamentals TS for C++17
P0092R1 Polishing <chrono>
P0007R1 Constant View: A proposal for a std::as_const helper function template
P0156R0 Variadic lock_guard (Rev. 3)
P0074R0 Making std::owner_less more flexible
P0013R1 Logical Operator Type Traits (revision 1)
Library Fundamentals TS v2 Papers
N4531 std::rand replacement, revision 3
P0013R1 Logical Operator Type Traits (revision 1) [also voted into C++17]
These papers will be applied to Working Draft N4529, then it'll be sent out for Proposed Draft Technical Specification balloting.
Concurrency TS
P0159R0 (possibly with minor edits) will be published as the Concurrency TS. It's done!
Parallelism TS v2
This TS is being started with Working Draft N4505 plus P0155R0 "Task Block R5".
Networking TS
This TS is being started with Working Draft P0112R1.
Ranges TS
This TS is being started with Working Draft P0021R0.
Core Issues
1274. Common nonterminal for expression and braced-init-list
1391. Conversions to parameter types with non-deduced template arguments
1722. Should lambda to function pointer conversion function be noexcept?
1847. Clarifying compatibility during partial ordering
1863. Requirements on thrown object type to support std::current_exception()
1949. "sequenced after" instead of "sequenced before"
1975. Permissible declarations for exception-specifications
1981. Implicit contextual conversions and explicit
1990. Ambiguity due to optional decl-specifier-seq
2000. header-name outside #include directive
2004. Unions with mutable members in constant expressions
2006. Cv-qualified void types
2015. odr-use of deleted virtual functions
2016. Confusing wording in description of conversion function
2019. Member references omitted from description of storage duration
2024. Dependent types and unexpanded parameter packs
2026. Zero-initialization and constexpr
2027. Unclear requirements for multiple alignas specifiers
2031. Missing incompatibility for &&
2052. Template argument deduction vs overloaded operators
2075. Passing short initializer lists to array reference parameters
2101. Incorrect description of type- and value-dependence
2120. Array as first non-static data member in standard-layout class
Library Issues
1169. num_get not fully compatible with strto*
2072. Unclear wording about capacity of temporary buffers
2101. Some transformation types can produce impossible types
2111. Which unexpected/terminate handler is called from the exception handling runtime?
2119. Missing hash specializations for extended integer types
2127. Move-construction with raw_storage_iterator
2133. Attitude to overloaded comma for iterators
2156. Unordered containers' reserve(n) reserves for n-1 elements
2218. Unclear how containers use allocator_traits::construct()
2219. INVOKE-ing a pointer to member with a reference_wrapper as the object expression
2224. Ambiguous status of access to non-live objects
2234. assert() should allow usage in constant expressions
2244. Issue on basic_istream::seekg
2250. Follow-up On Library Issue 2207
2259. Issues in 17.6.5.5 rules for member functions
2273. regex_match ambiguity
2336. is_trivially_constructible/is_trivially_assignable traits are always false
2353. std::next is over-constrained
2367. pair and tuple are not correctly implemented for is_constructible with no args
2380. May <cstdlib> provide long ::abs(long) and long long ::abs(long long)?
2384. Allocator's deallocate function needs better specification
2385. function::assign allocator argument doesn't make sense
2435. reference_wrapper::operator()'s Remark should be deleted
2447. Allocators and volatile-qualified value types
2462. std::ios_base::failure is overspecified
2466. allocator_traits::max_size() default behavior is incorrect
2469. Wrong specification of Requires clause of operator[] for map and unordered_map
2473. basic_filebuf's relation to C FILE semantics
2476. scoped_allocator_adaptor is not assignable
2477. Inconsistency of wordings in std::vector::erase() and std::deque::erase()
2483. throw_with_nested() should use is_final
2484. rethrow_if_nested() is doubly unimplementable
2485. get() should be overloaded for const tuple&&
2486. mem_fn() should be required to use perfect forwarding
2487. bind() should be const-overloaded, not cv-overloaded
2489. mem_fn() should be noexcept
2492. Clarify requirements for comp
2495. There is no such thing as an Exception Safety element
Library Fundamentals TS v2 Issues
2494. [fund.ts.v2] ostream_joiner needs noexcept
2500. [fund.ts.v2] fundts.memory.smartptr.shared.obs/6 should apply to cv-unqualified void
2515. [fund.ts.v2] Certain comparison operators of observer_ptr do not match synopsis
2517. [fund.ts.v2] Two propagate_const assignment operators have incorrect return type
2526. [fund.ts] Incorrect precondition for experimental::function::swap
Withdrawn Paper
P0005R2, by Alisdair Meredith, Tomasz Kaminski, and myself, wanted to do the following in C++17:
Add not_fn(), currently part of Fundamentals v2.
Remove not1()/not2(), the C++98/03 negators.
Remove result_type/argument_type/etc., the C++98/03/TR1 typedefs. (function::result_type will be preserved, and <random> will be unchanged.)
Nobody was worried about not_fn(), but the removals were controversial. Although we had a rationale for why removal without a period of deprecation was desirable, and I provided "zombie names" wording (allowing implementers to remain conformant while providing removed machinery for back-compat), a national body objected. Therefore, Alisdair is revising the paper for the next meeting. Now we'll add not_fn() and deprecate the old stuff in C++17 (plus "zombie names" wording for the auto_ptr/etc. removals that have already happened), followed by removal immediately after C++17 ships.
More Info
This is just a record of what documents were voted in. Every committee meeting involves lots of work that doesn't immediately result in papers voted in. For example, this meeting had active discussion about modules. As I always remind people, I attend the Library Working Group ("original recipe", not extra crispy Library Evolution) nearly all the time, so I can't follow everything that's going on in Library Evolution and (Core) Evolution. I might (or more likely, my double boss Steve might) be able to get GDR to spend some time on Reddit explaining what's going on with modularization.
I can personally answer (most) questions about Library topics, although most of my responses will be delayed until Mondayish. If you want to know what the LWG does, it's making sure that Library tech is actually usable. Everything sounds like fluffy kittens and apple pie until you look at an overload set and realize that it's horribly ambiguous and unusably broken. LWG 2451 is an excellent example of how the LWG serves as the defenders of Standard Library usability - optional<string> opt_str = "meow"; is currently bogus. That's fine for the Fundamentals TS (maybe), but a ship-stopper for optional getting into the International Standard. At this meeting, the LWG realized that the same kind of issue affects variant, which is heading towards the Fundamentals TS. We fix this stuff so you won't suffer.
2
u/frog_pow Oct 27 '15 edited Oct 27 '15
I'd say more like:
There are not many recoverable errors, and they are be handled easily enough(missing files, network connection).
Most others consist of errors that I not care to attempt to recover from, such as out of memory. I have no intention of trying to handle an error like that. Just abort the program without corrupting anything.
For an error like attempting to read the value of an optional<T> that is empty, I view that as a hard error, that should be fixed. It should trigger the debugger if enabled, it should print the exact line, and callstack, and any other useful information. There is no point in trying to recover from such an error. And throwing an exception here is moronic.
Anyway I'm not so much concerned with exceptions being slow, and just being a shitty way of dealing with errors. The exceptions thrown by the STL/Boost are actively annoying, not because they are slow, but because they tell me nothing useful.
Also the idea that we should care about move constructors triggering an exception is pure insanity. Look at all the time wasted with the variant design over this petty and irrelevant feature.