Movatterモバイル変換


[0]ホーム

URL:


Issue 194 - WG21 CWG Issues
Title
Identifying constructors
Status
tc1
Section
11.4.5 [class.ctor]
Submitter
Jamie Schmeiser

Created on2000-01-11.00:00:00 last changed275 months ago

Messages

msg314 (view)
Date: 2000-04-15.00:00:00

Proposed resolution (10/00):

  1. Add to 11.4 [class.mem] paragraph 13

    • every member function of classT [Note: thisrestriction does not apply to constructors, which do not have names(11.4.5 [class.ctor]). ];

    immediately following the line

    • every data member of classT;
  2. Change 11.4.5 [class.ctor] paragraph 1 from

    A special declarator syntax using an optionalfunction-specifier (9.2.3 [dcl.fct.spec])...

    to

    A special declarator syntax using an optional sequence offunction-specifiers (9.2.3 [dcl.fct.spec])...
msg258 (view)
Date: 2004-09-10.00:00:00

According to 11.4.5 [class.ctor]paragraph1, the syntax used in declaring a constructor allows at most onefunction-specifier. It is thus not permitted to declare aconstructor bothinline andexplicit. This seemsoverly restrictive.

On a related note, there doesn't seem to be any explicitprohibition against member functions with the same name as the class.(Such a prohibition might reasonably be expected to occur in11.4 [class.mem] paragraph 13, but memberfunctions are not listed there.)

One possible interpretation would be that such member functionswould violate the restrictions in6.4.7 [basic.scope.class] paragraph 1,because the class name would refer to the class at some points in theclass scope and to the member function at others. However, this seemsa bit tenuous. Is an explicit prohibition needed?

(See alsoissue 147.)

History
DateUserActionArgs
2003-04-25 00:00:00adminsetstatus: dr -> tc1
2000-11-18 00:00:00adminsetstatus: ready -> dr
2000-05-21 00:00:00adminsetmessages: +msg314
2000-05-21 00:00:00adminsetstatus: open -> ready
2000-01-11 00:00:00admincreate

[8]ページ先頭

©2009-2025 Movatter.jp