A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/CWG/issues/1333.html below:

CWG Issue 1333

This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-08-11

1333. Omission of const in a defaulted copy constructorSection: 9.6.2  [dcl.fct.def.default]     Status: CD3     Submitter: Daniel Krügler     Date: 2011-06-21

[Voted into the WP at the February, 2012 meeting; moved to DR at the October, 2012 meeting.]

Paragraph 1 of 9.6.2 [dcl.fct.def.default] allows an explicitly-defaulted copy constructor or copy assignment operator to have a parameter type that is a reference to non-const, even if the corresponding implicitly-declared function would have a reference to const. However, paragraph 2 says that a copy constructor or copy assignment operator that is defaulted on its first declaration, the parameter type must be exactly the same. Is there a good reason for the stricter rule for a function that is defaulted on its first declaration?

Proposed resolution (August, 2011):

  1. Change 9.6.2 [dcl.fct.def.default] paragraph 2 as follows:

  2. ...If a function is explicitly defaulted on its first declaration,

  3. Change 11.4.5.3 [class.copy.ctor] paragraph 12 as follows:

  4. A copy/move constructor for class X is trivial if it is not user-provided , its declared parameter type is the same as if it had been implicitly declared, and if...
  5. Change 11.4.5.3 [class.copy.ctor] paragraph 25 as follows:

  6. A copy/move assignment operator for class X is trivial if it is not user-provided , its declared parameter type is the same as if it had been implicitly declared, and if...

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4