Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7430187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:05:55+00:00 2026-05-29T09:05:55+00:00

At my employer, it is policy that we use initialization lists in the constructor

  • 0

At my employer, it is policy that we use initialization lists in the constructor because it is more efficient.

However, I am developing a class that has 45 data members requiring initialization. Per the policy, this would have to be done in an initialization list in the constructor.

Other than readability, what would be the disadvantage to a large initialization list?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:05:56+00:00Added an answer on May 29, 2026 at 9:05 am

    You can format a member initializer list over multiple physical source lines so there doesn’t have to be a readability issue.

    The larger issue is obviously the fact that you have classes with 45 data members. Nothing is going to make working with such classes particularly easy.


    AClass::AClass( type1 val1
                  , type2 val2
                  // ...
                  , type45 val45 )
    : mem1( val1 )
    , mem2( val2 )
    // ...
    , mem45( val45 )
    {
    }
    

    I argue is no less readable than:

    AClass::AClass( type1 val1
                  , type2 val2
                  // ...
                  , type45 val45 )
    {
        mem1 = val1;
        mem2 = val2;
         // ...
        mem45 = val45;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I tell my new employer that I can’t use the computer they gave me?
My employer has developed a utility that will run a stored procedure line by
I'm dealing with an issue with my current employer that has seriously made me
I have two models such that class Employer(models.Model): code = models.CharField(null=False,blank=False,default=) class JobTitle(models.Model): employer
My employer is currently trying out Fogbugz and one feature that would be nice
At a previous employer, we were writing binary messages that had to go over
How does your employer limit/prevent pirating of its products? Some have the view that
For my previous employer I've worked with Hibernate, and now that I'm in a
Suppose that I am writing two applications for my employer, we'll call them App1
My employer uses Dotfuscator on all our .Net production software. Because of this, we

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.