| ||||
| Comment on My talk at CppCon by Daniel Teske
So I looked through the paper in the core guidelines paper and all of that looks pretty fantastic. I’d love to try that out on Qt to see if the rules and the tool are suffiecently smart that the effort is reasonable. One pattern, that is very common in Qt, is that parents take ownership of their children. To give a concrete but example, imagine a class like this: (Drastically simplified to only the memory management.) class Thing Now the semantics of that are, pretty obvious. If a thing has a parent, then that parent takes care of deleting its children. Otherwise the user has to take care of that Thing. In pratice, for e.g. widgets in windows, pretty much everything has a parent and thus is automatically deleted, except for top level windows. So it does actually work pretty well. Now, since Qt values source and binary compability a lot, we can’t really change the API, but still I would like to change it so that the tools can detect memory errors in Qt code. The first step would probably to uses two constructors: Looking at the paper I couldn’t find any way to express the comments in code or annotations for the tools though. Any thoughs on this? Read More » | ||||
| | ||||
| ||||
Monday, October 5, 2015
FeedaMail: Comments for Sutterâs Mill
Subscribe to:
Comments (Atom)