P0221R1: Proposed wording for default comparisons, revision 3 -- Jens Maurer

A new WG21 paper is available. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: P0221R1

Date: 2016-03-17

P0221R1: Proposed wording for default comparisons, revision 3

by Jens Maurer

Excerpt:

Introduction

This paper presents design rationale and proposed wording to implement default comparisons for class types. It is a revision of N4532 with additional updates from the Evolution Working Group session at the Kona meeting of WG21 and in-depth discussions with interested parties.

This paper assumes that the reader is familar with N4475 "Default comparisons (R2)" by Bjarne Stroustrup. In particular, default comparisons are assumed to be implicit (i.e. require no extra syntax to be available).

P0221R0 amended by a clarification for template specializations was approved by EWG during the Jacksonville (2016-03) meeting of WG21. Blue text in the proposed wording indicates changes compared to P0221R0.

Changes since P0221R0

  • fix wording glitches
  • clarified the zero-subobject (= empty class) cases
  • clarified that the context for a subobject comparison is the top-level class definition
  • clarified that both slicing copy and slicing move are prohibited
  • two-phase name lookup applies when comparing members whose type was instantiated from a dependent type

P0206R1: A joining thread -- Ville Voutilainen

A new WG21 paper is available. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: P0206R1

Date: 2016-03-09

A joining thread

by Ville Voutilainen

Excerpt:

Changes from previous version

  • This paper revises P0206R0.
  • Removed the motivation elaboration, it can be found in the previous revision.
  • Removed the discarded solutions.
  • Added explanation for the std::thread-accessing functions and discarded alternatives for it.
  • Renamed safe_thread to joining_thread.
  • Used thread::id and thread::native_handle_type in joining_thread.
  • Updated proposed wording.

Abstract

C++ continues not to provide a thread type that would join() automatically on scope exit. This causes exception-safety problems, because failing to join() in all code paths causes the destructor of a std::thread to terminate(). This paper provides a solution that adds a new thread type that joins in its destructor, and is based on large-group and LEWG feedback given in Jacksonville. The proposal has been implemented and tested. 

CLion 2016.1 released: Better language support and new dev tools -- Anastasia Kazakova

Fresh from JetBrains:

CLion 2016.1 released: Better language support and new dev tools

by Anastasia Kazakova

Some C++-specific highlights from the announcement:

This release brings long-awaited support for variadic templates (C++11). With the related fixes in the function overload resolution, this makes it possible to resolve the code correctly and avoid many false positives in code analysis. This also means that Qt C++11 connect calls are resolved correctly in CLion:

Auto-import has been improved greatly for symbols from STL, and the quick documentation popup (Ctrl+Q on Linux/Windows, F1 on OS X) now shows lambda expressions, namespace aliases and explicit instantiation, as well as accurately redirecting hyperlinks:

CppCast Episode 49: Parallel Computing Strategies with Dori Exterman

Episode 49 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Dori Exterman to discuss parallel computing strategies and Incredibuild.

CppCast Episode 49: Parallel Computing Strategies with Dori Exterman

by Rob Irving and Jason Turner

About the interviewee:

An expert software developer and product strategist, Dori Exterman has 20 years of experience in the software development industry. As Chief Technical Officer of IncrediBuild, he directs the company's product strategy and is responsible for product vision, implementation, and technical partnerships. Before joining IncrediBuild, Dori held a variety of technical and product development roles at software companies, with a focus on architecture, performance and advanced technologies. He is an expert and frequent speaker on technological advancement in development tools specializing in Embarcadero (formerly Borland) environments, and manages the Israeli development forum for these tools.

Trip report: C++ standards meeting in Jacksonville, Feb-Mar 2016 -- Herb Sutter

A comprehensive trip report from the just-concluded ISO C++ meeting:

Trip report: Winter ISO C++ standards meeting

by Herb Sutter

From the article:

On March 5, the ISO C++ committee completed its winter meeting in Jacksonville, FL, USA. We had record-tying attendance, with over 110 experts officially representing eight national bodies. As usual, we met for six days Monday through Saturday, and around the clock from 8:30am till 10pm most days, after which many people still went back to hang out in the lobby or their rooms to update papers. — The hotel had a baby grand piano outside the main meeting room lobby, and so late at night you could often walk by and find one of several committee members playing a tune, while as usual people collaborated on their proposals, perched on couches and tables clustered around glowing rectangles, incanting standardese to the soft strains of Russian folk ballads and arena rock.

Here’s a summary of what happened, with some details about the current ISO C++ process so you can see just how the work is progressing and getting released. I’ve tried to add some links to the relevant feature design papers, or to the papers that summarize what was done which in turn usually carry more links to the design papers...

Jacksonville approved papers and issues

The following is a list of the papers approved at the Jacksonville meeting that ended on Saturday. Some of the papers appeared in the pre-meeting mailing or an earlier mailing; most were updated during the meeting and for convenience this post includes and links to copies of the approved papers. All updated approved papers will appear also in the official post-meeting mailing, as will the official minuted form of the following notes.

More readable summaries will be posted in trip reports. This post is primarily making the papers available for linking and reference.

 

Accept as Defect Reports the issues in P0167R2 (Core Language "ready" Issues) and apply their proposed resolutions to the C++ working paper.

Accept as Defect Reports the issues in P0263R1 (Core Language "tentatively ready" Issues) and apply their proposed resolutions to the C++ working paper.

Apply to the C++ working paper the proposed wording in P0188R1 ("Wording for [[fallthrough]] attribute").

Apply to the C++ working paper the proposed wording in P0189R1 ("Wording for [[nodiscard]] attribute").

Apply to the C++ working paper the proposed wording in P0212R1 ("Wording for [[maybe_unused]] attribute").

Apply to the C++ working paper the proposed wording in P0017R1 ("Extension to aggregate initialization").

Apply to the C++ working paper the proposed wording in P0170R1 ("Wording for Constexpr Lambda").

Apply to the C++ working paper the proposed wording in P0036R0 ("Unary Folds and Empty Parameter Packs (revision 1)").

Apply to the C++ working paper the proposed wording in P0184R0 ("Generalizing the Range-Based For Loop").

Apply to the C++ working paper the proposed wording in P0018R3 ("Lambda Capture of *this by Value as [=,*this]").

Apply to the C++ working paper the proposed wording in P0138R2 ("Construction Rules for enum class Values").

Apply to the C++ working paper the proposed wording in P0245R1 ("Hexadecimal floating literals for C++").

Request a new work item for a Technical Specification on C++ Extensions for Modules and create a working paper with P0143R2 ("Wording for Modules") as its initial content.

 

Apply the resolutions of the following issues in "Ready" status from P0165R1 to the C++ Working Paper:

2276 Missing requirement on std::promise::set_exception
2523 std::promise synopsis shows two set_value_at_thread_exit()'s for no apparent reason
2537 Constructors for priority_queue taking allocators should call make_heap

Note that the following issues, marked Ready in the paper, are not being advanced:

2253 [arrays.ts] dynarray should state which container requirements aren't met
2255 [arrays.ts] dynarray constructor ambiguity

 

Apply the resolutions of the following issues in "Tentatively Ready" status from P0165R1 to the C++ Working Paper:

2192 Validity and return type of std::abs(0u) is unclear
2450 (greater less greater_equal less_equal)<void> do not yield a total order for pointers
2520 N4089 broke initializing unique_ptr<T[]> from a nullptr
2545 Simplify wording for bind without explicitly specified return type
2557 Logical operator traits are broken in the zero-argument case
2559 Error in LWG 2234's resolution
2560 is_constructible underspecified when applied to a function type
2565 std::function's move constructor should guarantee nothrow for reference_wrappers and function pointers
2566 Requirements on the first template parameter of container adaptors
2571 §[map.modifiers]/2 imposes nonsensical requirement on insert(InputIterator, InputIterator)
2572 The remarks for shared_ptr::operator* should apply to cv-qualified void as well
2576 istream_iterator and ostream_iterator should use std::addressof
2577 {shared,unique}_lock should use std::addressof
2579 Inconsistency wrt Allocators in basic_string assignment vs. basic_string::assign
2581 Specialization of <type_traits> variable templates should be prohibited
2582 §[res.on.functions]/2's prohibition against incomplete types shouldn't apply to type traits
2583 There is no way to supply an allocator for basic_string(str, pos)
2585 forward_list::resize(size_type, const value_type&) effects incorrect
2586 Wrong value category used in scoped_allocator_adaptor::construct()
2590 Aggregate initialization for std::array

 

Apply the resolutions of the following issues in "Tentatively Ready" status from P0165R1 to the Library Fundamentals Working Paper:

2522 [fund.ts.v2] Contradiction in set_default_resource specification
2539 [fund.ts.v2] invocation_trait definition definition doesn't work for surrogate call functions
2558 [fund.ts.v2] Logical operator traits are broken in the zero-argument case
2574 [fund.ts.v2] std::experimental::function::operator=(F&&) should be constrained
2575 [fund.ts.v2] experimental::function::assign should be removed

 

Apply to the C++ Working Paper the Proposed Wording from P0024R2, The Parallelism TS Should be Standardized.

Apply to the C++ Working Paper the Proposed Wording from P0226R1, Mathematical Special Functions for C++17, v5.

Apply to the C++ Working Paper the Proposed Wording from P0220R1, Adopt Library Fundamentals V1 TS Components for C++17 (R1).

Apply to the C++ Working Paper the Proposed Wording from P0218R1, Adopt the File System TS for C++17.

Apply to the C++ Working Paper the Proposed Wording from P0033R1, Re-enabling shared_from_this (revision 1).

Apply to the C++ Working Paper the Proposed Wording from P0005R4, Adopt not_fn from Library Fundamentals 2 for C++17.

Apply to the C++ Working Paper the Proposed Wording from P0152R1, constexpr atomic::is_always_lock_free.

Apply to the C++ Working Paper the Proposed Wording from P0185R1, Adding [nothrow-]swappable traits, revision 3.

Apply to the C++ Working Paper the Proposed Wording from P0253R1, Fixing a design mistake in the searchers interface.

Apply to the C++ Working Paper the Proposed Wording from P0025R0, An algorithm to "clamp" a value between a pair of boundary values.

Apply to the C++ Working Paper the Proposed Wording from P0154R1, constexpr std::hardware_{constructive,destructive}_interference_size.

Apply to the C++ Working Paper the Proposed Wording from option #2 in P0030R1, Proposal to Introduce a 3-Argument Overload to std::hypot.

Apply to the C++ Working Paper the Proposed Wording from P0031R0, A Proposal to Add Constexpr Modifiers to reverse_iterator, move_iterator, array and Range Access and apply the resolution of LWG Issue 2296 - std::addressof should be constexpr. This issue is published in P0304R0.

Apply to the C++ Working Paper the Proposed Wording from P0272R1, Give 'std::string' a non-const '.data()' member function.

Apply to the C++ Working Paper the Proposed Wording from P0077R2, is_callable, the missing INVOKE related trait.