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

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.