You could use a typedef to define a callback and make clients supply it, something similar to qsort-but that's so old-hat.
你可以用typedef来定义一个回调并让客户机来提供这个回调,这种做法有些类似qsort——但那样太老土了。
Many STL containers let you play the same trick. Most programmers wouldn't call the qsort callback an event, but there's no reason you can't think of it that way.
借助许多STL容器也能实现同样的诀窍.大多数程序员不会调用qsort回调某个事件,但你没有理由不考虑那种方式。
To Invoke an Application-Supplied Algorithm The C runtime library function qsort sorts an array of objects, but you must supply the function that compares objects.
调用应用程序提供的算法:C运行时库函数qsort 排序对象数组,但你必须提供比较函数。
To Invoke an Application-Supplied Algorithm The C runtime library function qsort sorts an array of objects, but you must supply the function that compares objects.
调用应用程序提供的算法:C运行时库函数qsort 排序对象数组,但你必须提供比较函数。
应用推荐