Click here to Skip to main content
16,013,581 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help me please Pin
Member 417463927-Mar-08 5:43
Member 417463927-Mar-08 5:43 
GeneralRe: Help me please Pin
CPallini27-Mar-08 5:58
mveCPallini27-Mar-08 5:58 
GeneralRe: Help me please Pin
toxcct27-Mar-08 6:19
toxcct27-Mar-08 6:19 
GeneralRe: Help me please Pin
CPallini27-Mar-08 6:33
mveCPallini27-Mar-08 6:33 
GeneralException-Safe Copy Assignment Pin
George_George27-Mar-08 4:14
George_George27-Mar-08 4:14 
GeneralRe: Exception-Safe Copy Assignment Pin
led mike27-Mar-08 4:23
led mike27-Mar-08 4:23 
GeneralRe: Exception-Safe Copy Assignment Pin
George_George27-Mar-08 4:42
George_George27-Mar-08 4:42 
GeneralRe: Exception-Safe Copy Assignment Pin
CPallini27-Mar-08 4:32
mveCPallini27-Mar-08 4:32 
George_George wrote:
The reason why we can not write an exception safe copy assignment for class Widget, is because (suppose we assign t1_, then assign t2_) if T1::operator=() does not throw exception, and T2::operator=() throws exception, then since all operations on T1 may throw, it means we can not find any operations on T1 which could rollback the original status to T1 without exception thrown (if exception is thrown during rollback, means rollback is not successful, and T1 will be in an in-consistent status which is different from original status -- which violates the strong exception safe guideline).


You're interpretation is correct, but is not the whole scenario: it maybe also impossible to roll back because T1 class public interface simply doesn't allow it.
Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke


GeneralRe: Exception-Safe Copy Assignment Pin
George_George27-Mar-08 4:40
George_George27-Mar-08 4:40 
GeneralRe: Exception-Safe Copy Assignment Pin
led mike27-Mar-08 4:45
led mike27-Mar-08 4:45 
GeneralRe: Exception-Safe Copy Assignment Pin
peterchen27-Mar-08 5:51
peterchen27-Mar-08 5:51 
GeneralRe: Exception-Safe Copy Assignment Pin
George_George27-Mar-08 17:39
George_George27-Mar-08 17:39 
GeneralRe: Exception-Safe Copy Assignment Pin
led mike28-Mar-08 4:41
led mike28-Mar-08 4:41 
GeneralRe: Exception-Safe Copy Assignment Pin
George_George28-Mar-08 5:07
George_George28-Mar-08 5:07 
GeneralRe: Exception-Safe Copy Assignment Pin
led mike28-Mar-08 6:01
led mike28-Mar-08 6:01 
GeneralRe: Exception-Safe Copy Assignment Pin
George_George28-Mar-08 21:13
George_George28-Mar-08 21:13 
QuestionRe: Exception-Safe Copy Assignment Pin
CPallini27-Mar-08 4:49
mveCPallini27-Mar-08 4:49 
GeneralRe: Exception-Safe Copy Assignment Pin
George_George27-Mar-08 17:54
George_George27-Mar-08 17:54 
GeneralRe: Exception-Safe Copy Assignment Pin
CPallini27-Mar-08 22:17
mveCPallini27-Mar-08 22:17 
GeneralRe: Exception-Safe Copy Assignment Pin
George_George27-Mar-08 23:23
George_George27-Mar-08 23:23 
GeneralRe: Exception-Safe Copy Assignment Pin
CPallini27-Mar-08 23:41
mveCPallini27-Mar-08 23:41 
GeneralRe: Exception-Safe Copy Assignment Pin
George_George27-Mar-08 23:50
George_George27-Mar-08 23:50 
GeneralRe: Exception-Safe Copy Assignment Pin
led mike27-Mar-08 4:41
led mike27-Mar-08 4:41 
GeneralRe: Exception-Safe Copy Assignment Pin
George_George27-Mar-08 4:43
George_George27-Mar-08 4:43 
GeneralRe: Exception-Safe Copy Assignment Pin
led mike27-Mar-08 4:47
led mike27-Mar-08 4:47 

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.