Click here to Skip to main content
15,912,756 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerSure? Pin
CPallini15-Nov-07 22:31
mveCPallini15-Nov-07 22:31 
AnswerYou are missing quite a lot of braces here [modified] Pin
jhwurmbach16-Nov-07 3:43
jhwurmbach16-Nov-07 3:43 
GeneralRe: You are missing quite a lot of braces here Pin
CPallini16-Nov-07 4:30
mveCPallini16-Nov-07 4:30 
GeneralRe: You are missing quite a lot of braces here Pin
jhwurmbach18-Nov-07 22:04
jhwurmbach18-Nov-07 22:04 
GeneralRe: You are missing quite a lot of braces here Pin
CPallini18-Nov-07 22:24
mveCPallini18-Nov-07 22:24 
GeneralRe: You are missing quite a lot of braces here Pin
jhwurmbach18-Nov-07 22:35
jhwurmbach18-Nov-07 22:35 
GeneralRe: You are missing quite a lot of braces here Pin
CPallini18-Nov-07 22:46
mveCPallini18-Nov-07 22:46 
GeneralRe: You are missing quite a lot of braces here [modified] Pin
jhwurmbach18-Nov-07 22:48
jhwurmbach18-Nov-07 22:48 
OK, you won.
I am changing my function definition to
const CArray<type, type>& COpenFolderPage::GetPagesPath()

Oh- wait!

The Array is a function-local variable. We *have to* return it by value!

The compiler would have to do a copy anyway.
We have three objects involved:
TargetArray - temporary - Source( local to function)

The target being a mere reference is illegal, because the local variable goes out of scope.
So, in all possible implementations, two of the three objects can be merged in one by the optimizer, but never all three.
The compiler has to copy once.


-- modified at 4:58 Monday 19th November, 2007
(This modification overlapped with the replyh




Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all.
Douglas Adams, "Dirk Gently's Holistic Detective Agency"

GeneralOh, that isn't correct Pin
CPallini18-Nov-07 22:54
mveCPallini18-Nov-07 22:54 
GeneralRe: Oh, that isn't correct Pin
jhwurmbach18-Nov-07 23:01
jhwurmbach18-Nov-07 23:01 
GeneralRe: You are missing quite a lot of braces here Pin
CPallini18-Nov-07 23:21
mveCPallini18-Nov-07 23:21 
GeneralRe: You are missing quite a lot of braces here Pin
jhwurmbach18-Nov-07 23:27
jhwurmbach18-Nov-07 23:27 
GeneralRe: You are missing quite a lot of braces here Pin
CPallini18-Nov-07 23:37
mveCPallini18-Nov-07 23:37 
GeneralRe: You are missing quite a lot of braces here Pin
David Crow16-Nov-07 11:04
David Crow16-Nov-07 11:04 
GeneralRe: You are missing quite a lot of braces here Pin
jhwurmbach18-Nov-07 22:20
jhwurmbach18-Nov-07 22:20 
GeneralRe: You are missing quite a lot of braces here Pin
David Crow19-Nov-07 3:17
David Crow19-Nov-07 3:17 
QuestionHow to block CD/DVD Pin
VC_RYK15-Nov-07 21:50
VC_RYK15-Nov-07 21:50 
AnswerRe: How to block CD/DVD Pin
David Crow16-Nov-07 5:35
David Crow16-Nov-07 5:35 
GeneralRe: How to block CD/DVD Pin
VC_RYK18-Nov-07 19:37
VC_RYK18-Nov-07 19:37 
GeneralRe: How to block CD/DVD Pin
David Crow19-Nov-07 3:28
David Crow19-Nov-07 3:28 
QuestionHow to release unused memory at Runtime? Pin
bankey101015-Nov-07 20:53
bankey101015-Nov-07 20:53 
AnswerRe: How to release unused memory at Runtime? Pin
Cedric Moonen15-Nov-07 21:09
Cedric Moonen15-Nov-07 21:09 
Questionbreaking up an int in c programming Pin
neodeaths15-Nov-07 20:18
neodeaths15-Nov-07 20:18 
AnswerRe: breaking up an int in c programming Pin
codeII15-Nov-07 20:35
codeII15-Nov-07 20:35 
AnswerRe: breaking up an int in c programming Pin
Malli_S15-Nov-07 20:57
Malli_S15-Nov-07 20:57 

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.