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

C / C++ / MFC

 
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 
GeneralRe: Smart pointers Pin
Stefan_Lang17-Nov-11 4:37
Stefan_Lang17-Nov-11 4:37 
GeneralRe: Smart pointers Pin
Pascal Ganaye17-Nov-11 4:59
Pascal Ganaye17-Nov-11 4:59 
GeneralRe: Smart pointers Pin
Stefan_Lang17-Nov-11 5:47
Stefan_Lang17-Nov-11 5:47 
GeneralRe: Smart pointers Pin
Pascal Ganaye18-Nov-11 0:09
Pascal Ganaye18-Nov-11 0:09 
GeneralRe: Smart pointers Pin
Stefan_Lang18-Nov-11 0:28
Stefan_Lang18-Nov-11 0:28 
Well I don't 'fight' you, I just want to point out the problems. Consider this:

1. Dealing with pointers by yourself is tricky. But most people learn it soon enough.

2. Writing a class to automate this requires you to not only think of your code, but also the code of other users who will use that class. That is quite hard. Especially when you think of users who fail at 1.

3. Writing such a class to deal with multi-threading issues is mind-boggling!

It's not that I judge your abilities as poor, just that you might have set your goals too high. Me, I've tried myself at level 2, and although I thought I did it reasonably well, I know it wasn't quite perfect. I might be willing to experiment with sth at the level of 3, but I don't think I'd offer to write an article about it until after I know it works ...

On a sidenote, I did write an Object Pool implementation that hands out special smart pointers to make sure all pool items are released as soon as possible. In fact, the concept of releasing pool items ASAP runs a bit contrary to the idea of a pool, so in truth it's closer to a specialized garbage collector with 'immediate response'. That is about as close to garbage collection I dare go. And I only did it because I realized I could implement each function at a complexity of amortised O(1). Maybe I should put that up as an article, but I first have to fix memory alignment and then think up a new name...
QuestionCreateFile after CloseHandle Pin
aangerma14-Nov-11 23:49
aangerma14-Nov-11 23:49 
AnswerRe: CreateFile after CloseHandle Pin
User 742933814-Nov-11 23:58
professionalUser 742933814-Nov-11 23:58 
GeneralRe: CreateFile after CloseHandle Pin
aangerma15-Nov-11 0:09
aangerma15-Nov-11 0:09 
AnswerRe: CreateFile after CloseHandle Pin
User 742933815-Nov-11 0:20
professionalUser 742933815-Nov-11 0:20 
GeneralRe: CreateFile after CloseHandle Pin
aangerma15-Nov-11 0:35
aangerma15-Nov-11 0:35 
GeneralRe: CreateFile after CloseHandle Pin
Erudite_Eric15-Nov-11 1:37
Erudite_Eric15-Nov-11 1:37 
GeneralRe: CreateFile after CloseHandle Pin
Vaclav_15-Nov-11 10:45
Vaclav_15-Nov-11 10:45 
GeneralRe: CreateFile after CloseHandle Pin
Erudite_Eric15-Nov-11 21:19
Erudite_Eric15-Nov-11 21:19 
QuestionHide folder in window explorer Pin
MKC00214-Nov-11 22:40
MKC00214-Nov-11 22:40 
AnswerRe: Hide folder in window explorer Pin
Richard MacCutchan14-Nov-11 23:07
mveRichard MacCutchan14-Nov-11 23:07 
GeneralRe: Hide folder in window explorer Pin
MKC00215-Nov-11 21:33
MKC00215-Nov-11 21:33 
GeneralRe: Hide folder in window explorer Pin
Richard MacCutchan15-Nov-11 21:46
mveRichard MacCutchan15-Nov-11 21:46 
Questionconvert double to WCHAR Pin
jkirkerx14-Nov-11 16:32
professionaljkirkerx14-Nov-11 16:32 
AnswerRe: convert double to WCHAR Pin
David Crow14-Nov-11 16:54
David Crow14-Nov-11 16:54 
AnswerRe: convert double to WCHAR PinPopular
Peter_in_278014-Nov-11 17:06
professionalPeter_in_278014-Nov-11 17:06 
GeneralRe: convert double to WCHAR Pin
jkirkerx15-Nov-11 6:15
professionaljkirkerx15-Nov-11 6:15 
QuestionRe: convert double to WCHAR Pin
David Crow15-Nov-11 7:17
David Crow15-Nov-11 7: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.