也许我们认为可以通过定义一个虚函数集合来解决这个问题,这些虚函数可以在类层次中每一层执行相等测试。
We might think we could solve this problem by defining a set of virtual functions that would perform the equality test at each level in the hierarchy.
在我的测试中,虚表上的查询比做同样查询的TimeSeries函数要慢一个数量级。
In my tests, it can be an order of magnitude slower than a TimeSeries function that does the same query.
类包含或者继承一个或多个纯虚函数,这样的类就是抽象基类。
A class containing (or inheriting) one or more pure virtual functions is an abstract base class.
应用推荐