Movatterモバイル変換


[0]ホーム

URL:


Issue 75 - WG21 CWG Issues
Title
In-class initialized members must be const
Status
tc1
Section
11.4 [class.mem]
Submitter
John Wiegley

Created on1998-12-29.00:00:00 last changed277 months ago

Messages

msg83 (view)
Date: 1999-04-15.00:00:00

Proposed Resolution (10/99):Change the sentence in 11.4 [class.mem] paragraph 4to read:

Amember-declarator can contain aconstant-initializeronly if it declares astatic member(11.4.9 [class.static])ofconst integral orconst enumeration type,see 11.4.9.3 [class.static.data].
msg82 (view)
Date: 2022-11-20.07:54:16

The standard says, in11.4 [class.mem]paragraph 4:

Amember-declarator can contain aconstant-initializer onlyif it declares astatic member(11.4.9 [class.static])of integral or enumeration type, see11.4.9.3 [class.static.data].
But later, in the section on static class data member initialization,11.4.9.3 [class.static.data]paragraph 4, it says:
If astatic data member is ofconst integralorconst enumerationtype, its declaration in the class definition can specify aconstant-initializer which shall be an integral constant expression(7.7 [expr.const]). In that case, themember can appear in integral constant expressions within its scope.
The first paragraph should be modified to make it clear that it is not possibleto initialize a static data member in-line with a constant-initializer if thatdata member is of integral (or enumeration) type, and yet not const.

Proposed Resolution (10/99):Change the sentence in 11.4 [class.mem] paragraph 4to read:

Amember-declarator can contain aconstant-initializeronly if it declares astatic member(11.4.9 [class.static])ofconst integral orconst enumeration type,see 11.4.9.3 [class.static.data].
History
DateUserActionArgs
2003-04-25 00:00:00adminsetstatus: dr -> tc1
2000-02-23 00:00:00adminsetstatus: ready -> dr
1999-09-14 00:00:00adminsetmessages: +msg83
1998-12-29 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp