Click here to Skip to main content
15,918,108 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:16
George_George27-Jan-08 23:16 
GeneralRe: exception and global variable Pin
Maxwell Chen27-Jan-08 23:19
Maxwell Chen27-Jan-08 23:19 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:31
George_George27-Jan-08 23:31 
GeneralRe: exception and global variable Pin
Maxwell Chen27-Jan-08 23:34
Maxwell Chen27-Jan-08 23:34 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:40
George_George27-Jan-08 23:40 
GeneralRe: exception and global variable Pin
CPallini27-Jan-08 23:32
mveCPallini27-Jan-08 23:32 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:36
George_George27-Jan-08 23:36 
GeneralRe: exception and global variable Pin
Maxwell Chen27-Jan-08 23:40
Maxwell Chen27-Jan-08 23:40 
George_George wrote:
This will catch every exception, except those thrown by construction and destruction of global variables. There is no way of catching exceptions thrown during initialization of global variables. The only way of gaining control in case of throw from an initializer of a nonlocal static object is set_unexpected ($14.6.2). This is another reason to avoid global variable whenever possible.


Please mind that the subject (the 1st word, "This") is the below.
int main()
try {
}
catch(std::range_error) {
}
catch(std::bad_alloc) {
}
catch(...) {
}


  Maxwell Chen

GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:45
George_George27-Jan-08 23:45 
GeneralRe: exception and global variable Pin
Maxwell Chen27-Jan-08 23:54
Maxwell Chen27-Jan-08 23:54 
GeneralRe: exception and global variable Pin
CPallini27-Jan-08 23:45
mveCPallini27-Jan-08 23:45 
JokeRe: exception and global variable Pin
Cedric Moonen27-Jan-08 23:48
Cedric Moonen27-Jan-08 23:48 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:50
George_George27-Jan-08 23:50 
GeneralRe: exception and global variable Pin
Maxwell Chen27-Jan-08 23:52
Maxwell Chen27-Jan-08 23:52 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:59
George_George27-Jan-08 23:59 
GeneralRe: exception and global variable Pin
Maxwell Chen28-Jan-08 0:04
Maxwell Chen28-Jan-08 0:04 
JokeRe: exception and global variable Pin
CPallini28-Jan-08 0:07
mveCPallini28-Jan-08 0:07 
JokeRe: exception and global variable Pin
CPallini27-Jan-08 23:53
mveCPallini27-Jan-08 23:53 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:49
George_George27-Jan-08 23:49 
GeneralRe: exception and global variable Pin
CPallini28-Jan-08 0:04
mveCPallini28-Jan-08 0:04 
GeneralRe: exception and global variable Pin
George_George28-Jan-08 0:17
George_George28-Jan-08 0:17 
GeneralRe: exception and global variable Pin
CPallini28-Jan-08 0:36
mveCPallini28-Jan-08 0:36 
GeneralRe: exception and global variable Pin
George_George28-Jan-08 13:38
George_George28-Jan-08 13:38 
GeneralRe: exception and global variable Pin
Maxwell Chen27-Jan-08 23:49
Maxwell Chen27-Jan-08 23:49 
GeneralRe: exception and global variable Pin
George_George27-Jan-08 23:57
George_George27-Jan-08 23: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.