Tuesday, October 13, 2015

FeedaMail: Comments for Sutter’s Mill

feedamail.com Comments for Sutter's Mill

Comment on My talk at CppCon by Juergen Busch

I really was electrified by Bjarne’s and your talk. Resource and type safety is definitely an issue. I have seen many libraries where even a quick view into the code easily revealed at least the one or other resource leak. What might be in there too – but hidden much “better”?

So, I like the idea of owner to ease the work for an analysis tool (compiler or external based) and I liked to see how far you already got with such a tool. But I found no information how that might work with non-pointer resources or if it is even planned to extend it in that direction. You know, we have HANDLE-s and int-s as resources too.

I would like to have a unique_owner and shared_owner for such resources somewhat like unique_ptr and shared_ptr for pointers. When I tried to sketch such a unique_owner class following the guidelines I wondered how to signal the “deleter” (CloseHandle or such) for the owned resource to the analysis tool.

Did I miss something in the GSL documentation and/or your or Bjarne’s talk? Or would we need a deleter wrapper too that signals a function object to be the equivalent of delete for a non-pointer resource type T? Or is that idea of non-pointer resources owners a bad one?

Comments appreciated!

Read More »
 
Delievered to you by Feedamail.
Unsubscribe

No comments:

Post a Comment