Click here to Skip to main content
15,924,452 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: What's the difference? Pin
tas28261-Feb-06 6:10
tas28261-Feb-06 6:10 
GeneralRe: What's the difference? Pin
Nish Nishant1-Feb-06 6:13
sitebuilderNish Nishant1-Feb-06 6:13 
GeneralRe: What's the difference? Pin
tas28261-Feb-06 6:18
tas28261-Feb-06 6:18 
GeneralRe: What's the difference? Pin
Nish Nishant1-Feb-06 6:12
sitebuilderNish Nishant1-Feb-06 6:12 
AnswerRe: What's the difference? Pin
David Crow1-Feb-06 6:29
David Crow1-Feb-06 6:29 
AnswerRe: What's the difference? Pin
tas28261-Feb-06 6:41
tas28261-Feb-06 6:41 
GeneralRe: What's the difference? Pin
Ryan Binns1-Feb-06 17:42
Ryan Binns1-Feb-06 17:42 
AnswerRe: What's the difference? Pin
Eric Jacobsen1-Feb-06 10:49
Eric Jacobsen1-Feb-06 10:49 
Scott Meyers, in "Effective C++" says to "Prefer initialization to assignment in constructors" (Item 12)

"From a purely pragmatic point of view, there are times when the initialization list must be used. In particular, const and reference members may only be initialized, never assigned."

There is also a question of efficiency: "When a member initialization list is used, only a single string member function is called. When assignment inside the constructor is used, two are called. . . Even in the case of the lowly string type, the cost of an unnecessary function call may be significant, and as classes become larger and more complex, so do their constructors, and so does the cost of constructing objects. If you establish the habit of using a member initialization list whenever you can, not only do you satisfy a requirement for const and reference members, you also minimize the chances of initializing data members in an inefficient manner."

check out the book for the whole article--good stuff!



----------------------------------------
Please reply in the forum--my email is filtered
AnswerRe: What's the difference? Pin
Owner drawn1-Feb-06 16:59
Owner drawn1-Feb-06 16:59 
QuestionExporting dialog resources Pin
tas28261-Feb-06 5:12
tas28261-Feb-06 5:12 
AnswerRe: Exporting dialog resources Pin
David Crow1-Feb-06 5:15
David Crow1-Feb-06 5:15 
GeneralRe: Exporting dialog resources Pin
tas28261-Feb-06 5:41
tas28261-Feb-06 5:41 
AnswerRe: Exporting dialog resources Pin
Maximilien1-Feb-06 5:55
Maximilien1-Feb-06 5:55 
QuestionFont size: point ang logic Pin
includeh101-Feb-06 4:47
includeh101-Feb-06 4:47 
AnswerRe: Font size: point ang logic Pin
Shog91-Feb-06 15:55
sitebuilderShog91-Feb-06 15:55 
Questionwhen to upgrade vc6? Pin
ehh1-Feb-06 4:16
ehh1-Feb-06 4:16 
AnswerRe: when to upgrade vc6? Pin
David Crow1-Feb-06 5:14
David Crow1-Feb-06 5:14 
AnswerRe: when to upgrade vc6? Pin
Gavin Taylor1-Feb-06 6:10
professionalGavin Taylor1-Feb-06 6:10 
GeneralRe: when to upgrade vc6? Pin
David Crow1-Feb-06 6:34
David Crow1-Feb-06 6:34 
AnswerRe: when to upgrade vc6? Pin
Kevin McFarlane1-Feb-06 6:57
Kevin McFarlane1-Feb-06 6:57 
AnswerRe: when to upgrade vc6? Pin
ehh1-Feb-06 9:49
ehh1-Feb-06 9:49 
QuestionGetting Mouse Positions Pin
Allad1-Feb-06 4:15
Allad1-Feb-06 4:15 
AnswerRe: Getting Mouse Positions Pin
BlackDice1-Feb-06 4:34
BlackDice1-Feb-06 4:34 
GeneralRe: Getting Mouse Positions Pin
Allad1-Feb-06 5:07
Allad1-Feb-06 5:07 
AnswerRe: Getting Mouse Positions Pin
ThatsAlok1-Feb-06 19:23
ThatsAlok1-Feb-06 19:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.