Namespaces
Variants
Views
Actions

Talk:cpp/language/constructor

From cppreference.com

There are no description and exmaples of usage of parameter pack.

there is a mini-example in cpp/language/parameter_pack#Base_specifiers_and_member_initializer_lists, which is linked from here. --Cubbi (talk) 14:28, 28 April 2017 (PDT)

Contents

[edit] paramet-list definition

Even though the class-name's parameter-list is optional, it should be defined. The template parameter-list is defined, but not class.

[edit] example code throws error on Class() initializer list

ERROR C3511: 'Class': a call to a delegating constructor shall be the only member-initializer

173.73.189.6 09:29, 10 May 2018 (PDT)

[edit] NSDM vs. Member Subobjects / Base Class vs. Base Class Subobject

I'm fairly disappointed that we don't have a consensus regarding whether it is easier for non-lawyers to understand classes when the titular distinctions are made. Getting students to make the distinction, to understand that these things correspond but are not equal, becomes a significant burden to the student and the teacher of the C++ programming language, but is not that difficult to diagnose, correct or maintain when handled early. We should think more carefully about whether it is actually more difficult to understand, whether it is just more wordy and we don't like that, or whether the incorrect comprehension is simply what we are accustomed to.

Consider carefully whether "non-static data member" is clearer than "member subobject", because it is certainly not more brief.

I should propose we at least begin by making the distinction in the introductory sentence and the Syntax section, and any place that the complete phrase "non-static data member" occurs in the Explanation section (because it simultaneously improves clarity, teachability, and word count).

184.102.64.32 06:24, 1 May 2020 (PDT)

Please don't forget member references which aren't subobjects. --Fruderica (talk) 08:55, 1 May 2020 (PDT)
I really don't see how talking about subobjects adds clarity to this page (as opposed to cpp/language/object or cpp/language/ebo etc, where they are the subject matter) except, indeed, where members of reference type are mentioned, your edit was good. --Cubbi (talk) 09:56, 1 May 2020 (PDT)

[edit] Move this page to "cpp/language/constructor"

Reasons:

  1. "initializer list" might be misinterpreted as std::initializer_list.
  2. This page doesn't talk exclusively about member initializer lists; it touches on the concept of "constructor" as a whole.

"cpp/language/initializer list" should then be set to redirect to "cpp/language/constructor". — Radix (talk) 07:10, 1 May 2020 (PDT)

yes, perhaps it's a good idea to flip the redirects (currently cpp/language/constructor redirects here) --Cubbi (talk) 09:56, 1 May 2020 (PDT)
done --Cubbi (talk) 13:33, 14 May 2020 (PDT)