You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> In a member function declaration or definition, override ensures that the function is virtual and is overriding a virtual function from the base class. The program is ill-formed (a compile-time error is generated) if this is not true.
283
+
284
+
看一个简单的例子:
285
+
286
+
```c++
287
+
structA
288
+
{
289
+
virtual void foo();
290
+
void bar();
291
+
};
292
+
293
+
structB : A
294
+
{
295
+
void foo() const override; // Error: B::foo does not override A::foo
void bar() override; // Error: A::bar is not virtual
299
+
};
300
+
```
301
+
302
+
编译器实现 override 的方法很简单,如下:
303
+
304
+
> The override special identifier means that the compiler will check the base class(es) to see if there is a virtual function with this exact signature. And if there is not, the compiler will error out.
305
+
306
+
不过注意 override 和 final 一样,不是C++保留字:
307
+
308
+
> Note that neither override nor final are language keywords. They are technically identifiers; they only gain special meaning when used in those specific contexts. In any other location, they can be valid identifiers.
3. FULLTEXT索引:主要用来查找文本中的关键字,而不是直接与索引中的值相比较。Full-text索引跟其它索引大不相同,它更像是一个搜索引擎,而不是简单的 WHERE 语句的参数匹配。可以对某列分别进行full-text索引和B-Tree索引,两者互不冲突。Full-text索引配合MATCH AGAINST操作使用,而不是一般的WHERE语句加LIKE。
0 commit comments