Click here to Skip to main content
15,919,613 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Smart pointers Pin
Erudite_Eric15-Nov-11 7:33
Erudite_Eric15-Nov-11 7:33 
GeneralRe: Smart pointers Pin
JackDingler15-Nov-11 11:23
JackDingler15-Nov-11 11:23 
GeneralRe: Smart pointers Pin
Stefan_Lang17-Nov-11 4:42
Stefan_Lang17-Nov-11 4:42 
GeneralRe: Smart pointers Pin
JackDingler17-Nov-11 5:48
JackDingler17-Nov-11 5:48 
GeneralRe: Smart pointers Pin
Stefan_Lang17-Nov-11 5:56
Stefan_Lang17-Nov-11 5:56 
GeneralRe: Smart pointers Pin
Orjan Westin15-Nov-11 23:41
professionalOrjan Westin15-Nov-11 23:41 
GeneralRe: Smart pointers Pin
Erudite_Eric16-Nov-11 22:39
Erudite_Eric16-Nov-11 22:39 
GeneralRe: Smart pointers Pin
Orjan Westin21-Nov-11 4:33
professionalOrjan Westin21-Nov-11 4:33 
Not dogma, just efficiency. The scope where an allocated pointer is allocated to may not be the best scope for handling an exception. Without a smart pointer, you have to cover everything with a try-catch, deallocate in all catch clauses (and you'd better not miss one or you'll be leaking), and then rethrow.

So okay, smart pointer isn't needed, it just makes for sturdier, faster, and more concise code.
GeneralRe: Smart pointers Pin
Erudite_Eric21-Nov-11 5:59
Erudite_Eric21-Nov-11 5:59 
GeneralRe: Smart pointers Pin
Orjan Westin21-Nov-11 7:38
professionalOrjan Westin21-Nov-11 7:38 
GeneralRe: Smart pointers Pin
Stefan_Lang17-Nov-11 4:58
Stefan_Lang17-Nov-11 4:58 
GeneralRe: Smart pointers Pin
Orjan Westin21-Nov-11 4:35
professionalOrjan Westin21-Nov-11 4:35 
GeneralRe: Smart pointers Pin
Maximilien15-Nov-11 9:55
Maximilien15-Nov-11 9:55 
GeneralRe: Smart pointers Pin
JackDingler16-Nov-11 9:08
JackDingler16-Nov-11 9:08 
GeneralRe: Smart pointers Pin
Chris Losinger15-Nov-11 10:25
professionalChris Losinger15-Nov-11 10:25 
GeneralRe: Smart pointers Pin
Rick York16-Nov-11 13:30
mveRick York16-Nov-11 13:30 
GeneralRe: Smart pointers Pin
Chris Losinger16-Nov-11 13:47
professionalChris Losinger16-Nov-11 13:47 
GeneralRe: Smart pointers Pin
JackDingler15-Nov-11 11:26
JackDingler15-Nov-11 11:26 
GeneralRe: Smart pointers Pin
Pascal Ganaye15-Nov-11 11:32
Pascal Ganaye15-Nov-11 11:32 
GeneralRe: Smart pointers Pin
JackDingler15-Nov-11 11:42
JackDingler15-Nov-11 11:42 
GeneralRe: Smart pointers Pin
Pascal Ganaye15-Nov-11 11:46
Pascal Ganaye15-Nov-11 11:46 
GeneralRe: Smart pointers Pin
JackDingler15-Nov-11 12:01
JackDingler15-Nov-11 12:01 
GeneralRe: Smart pointers Pin
Pascal Ganaye15-Nov-11 21:52
Pascal Ganaye15-Nov-11 21:52 
GeneralRe: Smart pointers Pin
JackDingler16-Nov-11 2:04
JackDingler16-Nov-11 2:04 
GeneralRe: Smart pointers Pin
Erudite_Eric15-Nov-11 22:32
Erudite_Eric15-Nov-11 22:32 

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.