Click here to Skip to main content
15,900,369 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: New program queries Pin
CPallini15-Dec-07 3:28
mveCPallini15-Dec-07 3:28 
GeneralProblem when using DllMain() function Pin
ashishbhatt15-Dec-07 2:06
ashishbhatt15-Dec-07 2:06 
GeneralRe: Problem when using DllMain() function Pin
Mike Dimmick15-Dec-07 7:53
Mike Dimmick15-Dec-07 7:53 
GeneralRe: Problem when using DllMain() function Pin
ashishbhatt15-Dec-07 17:27
ashishbhatt15-Dec-07 17:27 
GeneralRe: Problem when using DllMain() function Pin
Mark Salsbery15-Dec-07 8:07
Mark Salsbery15-Dec-07 8:07 
GeneralGDI+ How to mask an image with a mask bitmap Pin
followait15-Dec-07 2:00
followait15-Dec-07 2:00 
GeneralRe: GDI+ How to mask an image with a mask bitmap Pin
Mark Salsbery15-Dec-07 8:11
Mark Salsbery15-Dec-07 8:11 
GeneralRe: GDI+ How to mask an image with a mask bitmap Pin
followait15-Dec-07 14:19
followait15-Dec-07 14:19 
GeneralCListCtrl in CDialogBar can't receive WM_CREATE Pin
followait15-Dec-07 1:29
followait15-Dec-07 1:29 
QuestionRe: CListCtrl in CDialogBar can't receive WM_CREATE Pin
CPallini15-Dec-07 1:49
mveCPallini15-Dec-07 1:49 
GeneralRe: CListCtrl in CDialogBar can't receive WM_CREATE Pin
followait15-Dec-07 2:06
followait15-Dec-07 2:06 
QuestionRe: CListCtrl in CDialogBar can't receive WM_CREATE Pin
CPallini15-Dec-07 2:44
mveCPallini15-Dec-07 2:44 
QuestionRe: CListCtrl in CDialogBar can't receive WM_CREATE Pin
Hamid_RT15-Dec-07 3:16
Hamid_RT15-Dec-07 3:16 
GeneralRe: CListCtrl in CDialogBar can't receive WM_CREATE Pin
followait15-Dec-07 14:20
followait15-Dec-07 14:20 
GeneralRe: CListCtrl in CDialogBar can't receive WM_CREATE Pin
Hamid_RT15-Dec-07 18:25
Hamid_RT15-Dec-07 18:25 
GeneralRe: CListCtrl in CDialogBar can't receive WM_CREATE Pin
Jörgen Sigvardsson15-Dec-07 11:04
Jörgen Sigvardsson15-Dec-07 11:04 
GeneralRe: CListCtrl in CDialogBar can't receive WM_CREATE Pin
followait15-Dec-07 14:22
followait15-Dec-07 14:22 
Generaldefault implementation of assignment operator Pin
George_George14-Dec-07 19:04
George_George14-Dec-07 19:04 
GeneralRe: default implementation of assignment operator Pin
CPallini15-Dec-07 0:45
mveCPallini15-Dec-07 0:45 
GeneralRe: default implementation of assignment operator Pin
George_George15-Dec-07 4:01
George_George15-Dec-07 4:01 
GeneralThanks Pin
CPallini15-Dec-07 5:21
mveCPallini15-Dec-07 5:21 
Generalnon-const reference and const reference Pin
George_George14-Dec-07 17:48
George_George14-Dec-07 17:48 
Hello everyone,


This is my understanding of non-const reference, const reference and their relationships with lvalue/rvalue. Please help to review whether it is correct and feel free to correct me. Thanks.

1. A const reference can be binded to a rvalue, for example, a temporary object. And the "life" of the temporary object is guaranteed to be extended and we can safely operate through the const-reference.

2. A non-const reference can not binded to a rvalue, I think the reason is rvalue is not addressable? And we can not change the rvalue through its reference? Are there any other reasons? I am not quite sure whether my understanding is fully correct. Since there are some non-modifiable lvalues (so we do not always need to modify values through its reference). I am still studying what is the reason in essence in compiler why a non-const reference can not be binded to a rvalue.

3. Both const and non-const reference can be binded to a lvalue.


thanks in advance,
George
GeneralRe: non-const reference and const reference Pin
Iain Clarke, Warrior Programmer14-Dec-07 22:36
Iain Clarke, Warrior Programmer14-Dec-07 22:36 
GeneralRe: non-const reference and const reference Pin
George_George15-Dec-07 4:02
George_George15-Dec-07 4:02 
GeneralRe: non-const reference and const reference Pin
Iain Clarke, Warrior Programmer15-Dec-07 4:17
Iain Clarke, Warrior Programmer15-Dec-07 4:17 

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.