[Interest] Qt 5.5.x
Till Oliver Knoll
till.oliver.knoll at gmail.com
Sat Sep 12 10:19:57 CEST 2015
> Am 11.09.2015 um 19:59 schrieb Matthew Woehlke <mwoehlke.floss at gmail.com>:
>> On 2015-09-11 13:41, Till Oliver Knoll wrote:
>> You can further reduce the "dependency tree" of your sources by
>> making use of the private "d-pointer" pattern (there is a name for
>> it which currently escapes me)
> PIMPL? ;-)
Exactly :) Even though I had the term "Cheshire Cat" in mind :) (I yet have to google why that pattern is named after a cat).
But while we're there, quoting from that article:
"One type of opaque pointer commonly used in C++ class declarations is the d-pointer. The d-pointer is the only private data member of the class and points to an instance of a struct. Named by Arnt Gulbrandsen of Trolltech, this method allows class declarations to omit private data members, except for the d-pointer itself. The result: (a) more of the class implementation is hidden from view; (b) adding new data members to the private struct does not affect binary compatibility; (c) the header file containing the class declaration only needs to #include those other files needed for the class interface, rather than for its implementation. One side benefit is that compilations are faster because the header file changes less often. The d-pointer is heavily used in the Qt and KDE libraries."
Couldn't have explained it better :) Oh and yes, Trolltech is the initial company(*) that brought us Qt! ;)
(*) IIRC they did have (slightly) different names before that
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest