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

C / C++ / MFC

 
AnswerRe: OT - question for real COM / RS232 guru Pin
Richard MacCutchan15-Nov-11 22:00
mveRichard MacCutchan15-Nov-11 22:00 
GeneralRe: OT - question for real COM / RS232 guru Pin
Vaclav_16-Nov-11 2:50
Vaclav_16-Nov-11 2:50 
GeneralRe: OT - question for real COM / RS232 guru Pin
Richard MacCutchan16-Nov-11 3:19
mveRichard MacCutchan16-Nov-11 3:19 
RantSmart pointers Pin
Pascal Ganaye15-Nov-11 6:15
Pascal Ganaye15-Nov-11 6:15 
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 
It would defintely be problematic for him to implement his approach in a current codebase.

As you point out, it requires a that there be a clear definition of ownership. You can't just willy nilly, delete the resource. You won't know when other modules are done with it. You'll end up with attempts to resolve a null pointer, and the exceptions that come with that.

So with his approach, you'll have to make sure that every user of the pointer is done with it, before deleting it. If you're doing this, then the smart pointer is unnecessary and just adds overhead.
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 
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 

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.