C/C++中的函数指针 一.引子 今天无聊刷了leetcode上的一道题,如下: Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value. Examples: [2,3,4] , the median is 3 [2,3], t…
The English version is available at: http://xizhizhu.blogspot.com/2010/11/beauty-of-qt-1-d-pointer-private.html 相信不少刚开始阅读Qt源代码的朋友在看到其中的Private类和诸如Q_D.Q_Q等宏时都会思考,为什么Qt要用这样一个设计模式呢?这样一段增加了不少复杂度的代码,到底有多大的好处呢?简单的说,这样的好处在于保证代码的二进制兼容性. 什么是二进制兼容性?大名鼎鼎的KDE项目是…