What is the correct term for the list that initializes the data members?











up vote
9
down vote

favorite













  • One colleague says initializer list, another initialization
    list
    .

  • One SO answer says initializer list, another initialization
    list
    .


Which is the correct* terminology?



PS: They all talk about data member initializer/ation lists.





*If correct is ambiguous to you, you can fall back to the term used be the Standard.










share|improve this question
























  • I've downvoted this because I think it is pointless to split hairs between the two variants of the term.
    – einpoklum
    Nov 23 at 23:35










  • @einpoklum thank for justifying your vote. You assume that I knew that there is no correct term, and both variants can be correct. I didn't, and I feel that I am not the only one. Sorry though for posting a pointless question that polluted your question feed.
    – gsamaras
    Nov 24 at 10:04















up vote
9
down vote

favorite













  • One colleague says initializer list, another initialization
    list
    .

  • One SO answer says initializer list, another initialization
    list
    .


Which is the correct* terminology?



PS: They all talk about data member initializer/ation lists.





*If correct is ambiguous to you, you can fall back to the term used be the Standard.










share|improve this question
























  • I've downvoted this because I think it is pointless to split hairs between the two variants of the term.
    – einpoklum
    Nov 23 at 23:35










  • @einpoklum thank for justifying your vote. You assume that I knew that there is no correct term, and both variants can be correct. I didn't, and I feel that I am not the only one. Sorry though for posting a pointless question that polluted your question feed.
    – gsamaras
    Nov 24 at 10:04













up vote
9
down vote

favorite









up vote
9
down vote

favorite












  • One colleague says initializer list, another initialization
    list
    .

  • One SO answer says initializer list, another initialization
    list
    .


Which is the correct* terminology?



PS: They all talk about data member initializer/ation lists.





*If correct is ambiguous to you, you can fall back to the term used be the Standard.










share|improve this question
















  • One colleague says initializer list, another initialization
    list
    .

  • One SO answer says initializer list, another initialization
    list
    .


Which is the correct* terminology?



PS: They all talk about data member initializer/ation lists.





*If correct is ambiguous to you, you can fall back to the term used be the Standard.







c++ class oop initialization terminology






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 at 16:25

























asked Nov 23 at 9:44









gsamaras

49.2k2398179




49.2k2398179












  • I've downvoted this because I think it is pointless to split hairs between the two variants of the term.
    – einpoklum
    Nov 23 at 23:35










  • @einpoklum thank for justifying your vote. You assume that I knew that there is no correct term, and both variants can be correct. I didn't, and I feel that I am not the only one. Sorry though for posting a pointless question that polluted your question feed.
    – gsamaras
    Nov 24 at 10:04


















  • I've downvoted this because I think it is pointless to split hairs between the two variants of the term.
    – einpoklum
    Nov 23 at 23:35










  • @einpoklum thank for justifying your vote. You assume that I knew that there is no correct term, and both variants can be correct. I didn't, and I feel that I am not the only one. Sorry though for posting a pointless question that polluted your question feed.
    – gsamaras
    Nov 24 at 10:04
















I've downvoted this because I think it is pointless to split hairs between the two variants of the term.
– einpoklum
Nov 23 at 23:35




I've downvoted this because I think it is pointless to split hairs between the two variants of the term.
– einpoklum
Nov 23 at 23:35












@einpoklum thank for justifying your vote. You assume that I knew that there is no correct term, and both variants can be correct. I didn't, and I feel that I am not the only one. Sorry though for posting a pointless question that polluted your question feed.
– gsamaras
Nov 24 at 10:04




@einpoklum thank for justifying your vote. You assume that I knew that there is no correct term, and both variants can be correct. I didn't, and I feel that I am not the only one. Sorry though for posting a pointless question that polluted your question feed.
– gsamaras
Nov 24 at 10:04












3 Answers
3






active

oldest

votes

















up vote
12
down vote



accepted











Which is the correct terminology?




"Correct" being ambiguous, let's see what:




  1. The Standard calls it,

  2. The C++ gurus call it,

  3. The vulgus calls it.


The Standard




[lass.base.init]/1&2



1 In the definition of a constructor for a class, initializers for direct and virtual base class subobjects and non-static data members can be specified by a ctor-initializer, which has the form



ctor-initializer:
: mem-initializer-list

mem-initializer-list:
mem-initializer ...opt
mem-initializer-list , mem-initializer ...opt

mem-initializer:
mem-initializer-id ( expression-list opt )
mem-initializer-id braced-init-list

mem-initializer-id:
class-or-decltype
identifier


2 In a mem-initializer-id an initial unqualified identifier is looked up in the scope of the constructor's class and, if not found in that scope, it is looked up in the scope containing the constructor's definition. [ Note: If the constructor's class contains a member with the same name as a direct or virtual base class of the class, a mem-initializer-id naming the member or base class and composed of a single identifier refers to the class member. A mem-initializer-id for the hidden base class may be specified using a qualified name. — end note ] Unless the mem-initializer-id names the constructor's class, a non-static data member of the constructor's class, or a direct or virtual base of that class, the mem-initializer is ill-formed.




It's called a mem-initializer-list: this is a technical term I won't use personally.



The C++ guru



I'm currently watching the talks given at the CppCon2018, by likes of Herb Sutter, Kate Gregory, Timur Doumler, John Lakos, ... This is available on Youtube and I suggest you watch it too.



They use the term the initialiser list. Or when it's ambiguous the member initialiser list.



Now, let's compare some search results:



                               +----------------+-------------+
| Google scholar | Google book |
+------------------------------+----------------+-------------+
| "member initialization list" | 59 results | 948 results |
| "member initializer list" | 34 results | 553 results |
+------------------------------+----------------+-------------+


On written media, those gurus (well, everybody can write a paper or a book, but gurus tend to write more of those) call it the member initialization list most of the time.



Common C++ programmers



Well, there's the one that don't know what this is, and there's the one I've heard call it the initialiser list. I call it the initialiser list, even when talking in my mother tongue. In French, I've heard collegues call it what would translate to the initialisation list. There's some variation then I guess.



Conclusion



Call it the initialiser list. This is the correct term for me.






share|improve this answer























  • Today, while checking C++ version support for my answer, I got this warning: warning: extended initializer lists only available with -std=c++11, which further supports your answer.
    – gsamaras
    2 days ago




















up vote
5
down vote













The C++ standards - to date at least - only use the syntactic description mem-initializer-list which is specified as part of the parsing rules. The description is in a section entitled "Initializing bases and members" in all versions of the C++ standard dated 1998 and later. The section number does change (e.g. it's 12.6.2 in C++98, and 15.6.2 in C++17).



There is no english language description in the standard. Conventionally, people therefore use whatever wording that they consider represents the concept.



Personally, I use the term "initialiser list" since I am an english speaker in a country with accepted language more influenced by the United Kingdom than the United States.






share|improve this answer






























    up vote
    3
    down vote













    CPP standard draft N4713 states:




    15.6.2 Initializing bases and members [class.base.init]



    3 A mem-initializer-list can initialize a base class using any class-or-decltype that denotes that base class type.



    struct A { A(); }; 
    typedef A global_A;
    struct B { };
    struct C: public A, public B { C(); };
    C::C(): global_A() { } // mem-initializer for base A


    5 A ctor-initializer may initialize a variant member of the constructor’s class. If a ctor-initializer specifies more than one mem-initializer for the same member or for the same base class, the ctor-initializer is ill-formed.





    • Bjarne Stroustrup uses the term member initializer list in his book "The C++ Programming Language" 4th Edition.


    • Scott Meyers uses the term member initialization list in his book "Effective C++" Item 4. He does not use the term used by the standard.


    • Online CPP FAQ (https://isocpp.org) uses the term constructor’s initialization list.







    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53444145%2fwhat-is-the-correct-term-for-the-list-that-initializes-the-data-members%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      12
      down vote



      accepted











      Which is the correct terminology?




      "Correct" being ambiguous, let's see what:




      1. The Standard calls it,

      2. The C++ gurus call it,

      3. The vulgus calls it.


      The Standard




      [lass.base.init]/1&2



      1 In the definition of a constructor for a class, initializers for direct and virtual base class subobjects and non-static data members can be specified by a ctor-initializer, which has the form



      ctor-initializer:
      : mem-initializer-list

      mem-initializer-list:
      mem-initializer ...opt
      mem-initializer-list , mem-initializer ...opt

      mem-initializer:
      mem-initializer-id ( expression-list opt )
      mem-initializer-id braced-init-list

      mem-initializer-id:
      class-or-decltype
      identifier


      2 In a mem-initializer-id an initial unqualified identifier is looked up in the scope of the constructor's class and, if not found in that scope, it is looked up in the scope containing the constructor's definition. [ Note: If the constructor's class contains a member with the same name as a direct or virtual base class of the class, a mem-initializer-id naming the member or base class and composed of a single identifier refers to the class member. A mem-initializer-id for the hidden base class may be specified using a qualified name. — end note ] Unless the mem-initializer-id names the constructor's class, a non-static data member of the constructor's class, or a direct or virtual base of that class, the mem-initializer is ill-formed.




      It's called a mem-initializer-list: this is a technical term I won't use personally.



      The C++ guru



      I'm currently watching the talks given at the CppCon2018, by likes of Herb Sutter, Kate Gregory, Timur Doumler, John Lakos, ... This is available on Youtube and I suggest you watch it too.



      They use the term the initialiser list. Or when it's ambiguous the member initialiser list.



      Now, let's compare some search results:



                                     +----------------+-------------+
      | Google scholar | Google book |
      +------------------------------+----------------+-------------+
      | "member initialization list" | 59 results | 948 results |
      | "member initializer list" | 34 results | 553 results |
      +------------------------------+----------------+-------------+


      On written media, those gurus (well, everybody can write a paper or a book, but gurus tend to write more of those) call it the member initialization list most of the time.



      Common C++ programmers



      Well, there's the one that don't know what this is, and there's the one I've heard call it the initialiser list. I call it the initialiser list, even when talking in my mother tongue. In French, I've heard collegues call it what would translate to the initialisation list. There's some variation then I guess.



      Conclusion



      Call it the initialiser list. This is the correct term for me.






      share|improve this answer























      • Today, while checking C++ version support for my answer, I got this warning: warning: extended initializer lists only available with -std=c++11, which further supports your answer.
        – gsamaras
        2 days ago

















      up vote
      12
      down vote



      accepted











      Which is the correct terminology?




      "Correct" being ambiguous, let's see what:




      1. The Standard calls it,

      2. The C++ gurus call it,

      3. The vulgus calls it.


      The Standard




      [lass.base.init]/1&2



      1 In the definition of a constructor for a class, initializers for direct and virtual base class subobjects and non-static data members can be specified by a ctor-initializer, which has the form



      ctor-initializer:
      : mem-initializer-list

      mem-initializer-list:
      mem-initializer ...opt
      mem-initializer-list , mem-initializer ...opt

      mem-initializer:
      mem-initializer-id ( expression-list opt )
      mem-initializer-id braced-init-list

      mem-initializer-id:
      class-or-decltype
      identifier


      2 In a mem-initializer-id an initial unqualified identifier is looked up in the scope of the constructor's class and, if not found in that scope, it is looked up in the scope containing the constructor's definition. [ Note: If the constructor's class contains a member with the same name as a direct or virtual base class of the class, a mem-initializer-id naming the member or base class and composed of a single identifier refers to the class member. A mem-initializer-id for the hidden base class may be specified using a qualified name. — end note ] Unless the mem-initializer-id names the constructor's class, a non-static data member of the constructor's class, or a direct or virtual base of that class, the mem-initializer is ill-formed.




      It's called a mem-initializer-list: this is a technical term I won't use personally.



      The C++ guru



      I'm currently watching the talks given at the CppCon2018, by likes of Herb Sutter, Kate Gregory, Timur Doumler, John Lakos, ... This is available on Youtube and I suggest you watch it too.



      They use the term the initialiser list. Or when it's ambiguous the member initialiser list.



      Now, let's compare some search results:



                                     +----------------+-------------+
      | Google scholar | Google book |
      +------------------------------+----------------+-------------+
      | "member initialization list" | 59 results | 948 results |
      | "member initializer list" | 34 results | 553 results |
      +------------------------------+----------------+-------------+


      On written media, those gurus (well, everybody can write a paper or a book, but gurus tend to write more of those) call it the member initialization list most of the time.



      Common C++ programmers



      Well, there's the one that don't know what this is, and there's the one I've heard call it the initialiser list. I call it the initialiser list, even when talking in my mother tongue. In French, I've heard collegues call it what would translate to the initialisation list. There's some variation then I guess.



      Conclusion



      Call it the initialiser list. This is the correct term for me.






      share|improve this answer























      • Today, while checking C++ version support for my answer, I got this warning: warning: extended initializer lists only available with -std=c++11, which further supports your answer.
        – gsamaras
        2 days ago















      up vote
      12
      down vote



      accepted







      up vote
      12
      down vote



      accepted







      Which is the correct terminology?




      "Correct" being ambiguous, let's see what:




      1. The Standard calls it,

      2. The C++ gurus call it,

      3. The vulgus calls it.


      The Standard




      [lass.base.init]/1&2



      1 In the definition of a constructor for a class, initializers for direct and virtual base class subobjects and non-static data members can be specified by a ctor-initializer, which has the form



      ctor-initializer:
      : mem-initializer-list

      mem-initializer-list:
      mem-initializer ...opt
      mem-initializer-list , mem-initializer ...opt

      mem-initializer:
      mem-initializer-id ( expression-list opt )
      mem-initializer-id braced-init-list

      mem-initializer-id:
      class-or-decltype
      identifier


      2 In a mem-initializer-id an initial unqualified identifier is looked up in the scope of the constructor's class and, if not found in that scope, it is looked up in the scope containing the constructor's definition. [ Note: If the constructor's class contains a member with the same name as a direct or virtual base class of the class, a mem-initializer-id naming the member or base class and composed of a single identifier refers to the class member. A mem-initializer-id for the hidden base class may be specified using a qualified name. — end note ] Unless the mem-initializer-id names the constructor's class, a non-static data member of the constructor's class, or a direct or virtual base of that class, the mem-initializer is ill-formed.




      It's called a mem-initializer-list: this is a technical term I won't use personally.



      The C++ guru



      I'm currently watching the talks given at the CppCon2018, by likes of Herb Sutter, Kate Gregory, Timur Doumler, John Lakos, ... This is available on Youtube and I suggest you watch it too.



      They use the term the initialiser list. Or when it's ambiguous the member initialiser list.



      Now, let's compare some search results:



                                     +----------------+-------------+
      | Google scholar | Google book |
      +------------------------------+----------------+-------------+
      | "member initialization list" | 59 results | 948 results |
      | "member initializer list" | 34 results | 553 results |
      +------------------------------+----------------+-------------+


      On written media, those gurus (well, everybody can write a paper or a book, but gurus tend to write more of those) call it the member initialization list most of the time.



      Common C++ programmers



      Well, there's the one that don't know what this is, and there's the one I've heard call it the initialiser list. I call it the initialiser list, even when talking in my mother tongue. In French, I've heard collegues call it what would translate to the initialisation list. There's some variation then I guess.



      Conclusion



      Call it the initialiser list. This is the correct term for me.






      share|improve this answer















      Which is the correct terminology?




      "Correct" being ambiguous, let's see what:




      1. The Standard calls it,

      2. The C++ gurus call it,

      3. The vulgus calls it.


      The Standard




      [lass.base.init]/1&2



      1 In the definition of a constructor for a class, initializers for direct and virtual base class subobjects and non-static data members can be specified by a ctor-initializer, which has the form



      ctor-initializer:
      : mem-initializer-list

      mem-initializer-list:
      mem-initializer ...opt
      mem-initializer-list , mem-initializer ...opt

      mem-initializer:
      mem-initializer-id ( expression-list opt )
      mem-initializer-id braced-init-list

      mem-initializer-id:
      class-or-decltype
      identifier


      2 In a mem-initializer-id an initial unqualified identifier is looked up in the scope of the constructor's class and, if not found in that scope, it is looked up in the scope containing the constructor's definition. [ Note: If the constructor's class contains a member with the same name as a direct or virtual base class of the class, a mem-initializer-id naming the member or base class and composed of a single identifier refers to the class member. A mem-initializer-id for the hidden base class may be specified using a qualified name. — end note ] Unless the mem-initializer-id names the constructor's class, a non-static data member of the constructor's class, or a direct or virtual base of that class, the mem-initializer is ill-formed.




      It's called a mem-initializer-list: this is a technical term I won't use personally.



      The C++ guru



      I'm currently watching the talks given at the CppCon2018, by likes of Herb Sutter, Kate Gregory, Timur Doumler, John Lakos, ... This is available on Youtube and I suggest you watch it too.



      They use the term the initialiser list. Or when it's ambiguous the member initialiser list.



      Now, let's compare some search results:



                                     +----------------+-------------+
      | Google scholar | Google book |
      +------------------------------+----------------+-------------+
      | "member initialization list" | 59 results | 948 results |
      | "member initializer list" | 34 results | 553 results |
      +------------------------------+----------------+-------------+


      On written media, those gurus (well, everybody can write a paper or a book, but gurus tend to write more of those) call it the member initialization list most of the time.



      Common C++ programmers



      Well, there's the one that don't know what this is, and there's the one I've heard call it the initialiser list. I call it the initialiser list, even when talking in my mother tongue. In French, I've heard collegues call it what would translate to the initialisation list. There's some variation then I guess.



      Conclusion



      Call it the initialiser list. This is the correct term for me.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Nov 25 at 9:04









      gsamaras

      49.2k2398179




      49.2k2398179










      answered Nov 23 at 10:03









      YSC

      20.2k34593




      20.2k34593












      • Today, while checking C++ version support for my answer, I got this warning: warning: extended initializer lists only available with -std=c++11, which further supports your answer.
        – gsamaras
        2 days ago




















      • Today, while checking C++ version support for my answer, I got this warning: warning: extended initializer lists only available with -std=c++11, which further supports your answer.
        – gsamaras
        2 days ago


















      Today, while checking C++ version support for my answer, I got this warning: warning: extended initializer lists only available with -std=c++11, which further supports your answer.
      – gsamaras
      2 days ago






      Today, while checking C++ version support for my answer, I got this warning: warning: extended initializer lists only available with -std=c++11, which further supports your answer.
      – gsamaras
      2 days ago














      up vote
      5
      down vote













      The C++ standards - to date at least - only use the syntactic description mem-initializer-list which is specified as part of the parsing rules. The description is in a section entitled "Initializing bases and members" in all versions of the C++ standard dated 1998 and later. The section number does change (e.g. it's 12.6.2 in C++98, and 15.6.2 in C++17).



      There is no english language description in the standard. Conventionally, people therefore use whatever wording that they consider represents the concept.



      Personally, I use the term "initialiser list" since I am an english speaker in a country with accepted language more influenced by the United Kingdom than the United States.






      share|improve this answer



























        up vote
        5
        down vote













        The C++ standards - to date at least - only use the syntactic description mem-initializer-list which is specified as part of the parsing rules. The description is in a section entitled "Initializing bases and members" in all versions of the C++ standard dated 1998 and later. The section number does change (e.g. it's 12.6.2 in C++98, and 15.6.2 in C++17).



        There is no english language description in the standard. Conventionally, people therefore use whatever wording that they consider represents the concept.



        Personally, I use the term "initialiser list" since I am an english speaker in a country with accepted language more influenced by the United Kingdom than the United States.






        share|improve this answer

























          up vote
          5
          down vote










          up vote
          5
          down vote









          The C++ standards - to date at least - only use the syntactic description mem-initializer-list which is specified as part of the parsing rules. The description is in a section entitled "Initializing bases and members" in all versions of the C++ standard dated 1998 and later. The section number does change (e.g. it's 12.6.2 in C++98, and 15.6.2 in C++17).



          There is no english language description in the standard. Conventionally, people therefore use whatever wording that they consider represents the concept.



          Personally, I use the term "initialiser list" since I am an english speaker in a country with accepted language more influenced by the United Kingdom than the United States.






          share|improve this answer














          The C++ standards - to date at least - only use the syntactic description mem-initializer-list which is specified as part of the parsing rules. The description is in a section entitled "Initializing bases and members" in all versions of the C++ standard dated 1998 and later. The section number does change (e.g. it's 12.6.2 in C++98, and 15.6.2 in C++17).



          There is no english language description in the standard. Conventionally, people therefore use whatever wording that they consider represents the concept.



          Personally, I use the term "initialiser list" since I am an english speaker in a country with accepted language more influenced by the United Kingdom than the United States.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 23 at 23:27

























          answered Nov 23 at 10:04









          Peter

          27.2k32154




          27.2k32154






















              up vote
              3
              down vote













              CPP standard draft N4713 states:




              15.6.2 Initializing bases and members [class.base.init]



              3 A mem-initializer-list can initialize a base class using any class-or-decltype that denotes that base class type.



              struct A { A(); }; 
              typedef A global_A;
              struct B { };
              struct C: public A, public B { C(); };
              C::C(): global_A() { } // mem-initializer for base A


              5 A ctor-initializer may initialize a variant member of the constructor’s class. If a ctor-initializer specifies more than one mem-initializer for the same member or for the same base class, the ctor-initializer is ill-formed.





              • Bjarne Stroustrup uses the term member initializer list in his book "The C++ Programming Language" 4th Edition.


              • Scott Meyers uses the term member initialization list in his book "Effective C++" Item 4. He does not use the term used by the standard.


              • Online CPP FAQ (https://isocpp.org) uses the term constructor’s initialization list.







              share|improve this answer



























                up vote
                3
                down vote













                CPP standard draft N4713 states:




                15.6.2 Initializing bases and members [class.base.init]



                3 A mem-initializer-list can initialize a base class using any class-or-decltype that denotes that base class type.



                struct A { A(); }; 
                typedef A global_A;
                struct B { };
                struct C: public A, public B { C(); };
                C::C(): global_A() { } // mem-initializer for base A


                5 A ctor-initializer may initialize a variant member of the constructor’s class. If a ctor-initializer specifies more than one mem-initializer for the same member or for the same base class, the ctor-initializer is ill-formed.





                • Bjarne Stroustrup uses the term member initializer list in his book "The C++ Programming Language" 4th Edition.


                • Scott Meyers uses the term member initialization list in his book "Effective C++" Item 4. He does not use the term used by the standard.


                • Online CPP FAQ (https://isocpp.org) uses the term constructor’s initialization list.







                share|improve this answer

























                  up vote
                  3
                  down vote










                  up vote
                  3
                  down vote









                  CPP standard draft N4713 states:




                  15.6.2 Initializing bases and members [class.base.init]



                  3 A mem-initializer-list can initialize a base class using any class-or-decltype that denotes that base class type.



                  struct A { A(); }; 
                  typedef A global_A;
                  struct B { };
                  struct C: public A, public B { C(); };
                  C::C(): global_A() { } // mem-initializer for base A


                  5 A ctor-initializer may initialize a variant member of the constructor’s class. If a ctor-initializer specifies more than one mem-initializer for the same member or for the same base class, the ctor-initializer is ill-formed.





                  • Bjarne Stroustrup uses the term member initializer list in his book "The C++ Programming Language" 4th Edition.


                  • Scott Meyers uses the term member initialization list in his book "Effective C++" Item 4. He does not use the term used by the standard.


                  • Online CPP FAQ (https://isocpp.org) uses the term constructor’s initialization list.







                  share|improve this answer














                  CPP standard draft N4713 states:




                  15.6.2 Initializing bases and members [class.base.init]



                  3 A mem-initializer-list can initialize a base class using any class-or-decltype that denotes that base class type.



                  struct A { A(); }; 
                  typedef A global_A;
                  struct B { };
                  struct C: public A, public B { C(); };
                  C::C(): global_A() { } // mem-initializer for base A


                  5 A ctor-initializer may initialize a variant member of the constructor’s class. If a ctor-initializer specifies more than one mem-initializer for the same member or for the same base class, the ctor-initializer is ill-formed.





                  • Bjarne Stroustrup uses the term member initializer list in his book "The C++ Programming Language" 4th Edition.


                  • Scott Meyers uses the term member initialization list in his book "Effective C++" Item 4. He does not use the term used by the standard.


                  • Online CPP FAQ (https://isocpp.org) uses the term constructor’s initialization list.








                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 23 at 10:34

























                  answered Nov 23 at 9:58









                  P.W

                  9,7112742




                  9,7112742






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53444145%2fwhat-is-the-correct-term-for-the-list-that-initializes-the-data-members%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Plaza Victoria

                      Puebla de Zaragoza

                      Musa