A RetroSearch Logo

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

Search Query:

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

CWG Issue 1435

Constructors do not have names. A special declarator syntax is used to declare or define the constructor. The syntax uses:

in that order. In such a declaration, optional parentheses around the constructor class name are ignored. A declaration of a constructor uses a function declarator (9.3.4.6 [dcl.fct]) of the form

where the ptr-declarator consists solely of an id-expression, an optional attribute-specifier-seq, and optional surrounding parentheses, and the id-expression has one of the following forms:

The class-name shall not be a typedef-name. In a constructor declaration, each decl-specifier in the optional decl-specifier-seq shall be friend, inline, explicit, or constexpr. [Example:...

A special declarator syntax using an optional function-specifier (9.2.3 [dcl.fct.spec]) followed by ~ followed by the destructor's class name followed by an empty parameter list is used to declare the destructor in a class definition. In such a declaration, the ~ followed by the destructor's class name can be enclosed in optional parentheses; such parentheses are ignored. A typedef-name shall not be used as the class-name following the ~ in the declarator for a destructor declaration. A declaration of a destructor uses a function declarator (9.3.4.6 [dcl.fct]) of the form

where the ptr-declarator consists solely of an id-expression, an optional attribute-specifier-seq, and optional surrounding parentheses, and the id-expression has one of the following forms:

The class-name shall not be a typedef-name. A destructor shall take no arguments (9.3.4.6 [dcl.fct]). In a destructor declaration, each decl-specifier of the optional decl-specifier-seq shall be friend, inline, or virtual.

A destructor is used to destroy objects of its class type. A destructor takes no parameters, and no return type can be specified for it (not even void). The address of a destructor shall not be taken. A destructor shall not be static. A destructor can be invoked for a const, volatile or const volatile object. A destructor shall not be declared const, volatile or const volatile (_N4868_.11.4.3.2 [class.this]).const and volatile semantics (9.2.9.2 [dcl.type.cv]) are not applied on an object under destruction. They stop being in effect when the destructor for the most derived object (6.7.2 [intro.object]) starts. A destructor shall not be declared with a ref-qualifier.


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