## Most Vexing Parse
In C++, some declarations are ambiguous; the grammar cannot distinguish the direct-initialization style of variable definition from the declaration of a function's signature.
The below example can be read either as:
- The declaration of a variable `i` that holds the value of `n` casted into an `int`
- The declaration of a function `i` whose parameter `n` is an `int`, `int i(int n);`
```cpp
void f(double n) {
int i(int(n));
}
```
The C++ standard requires that such syntactic ambiguities are resolved by being interpreted as the latter. This is the **most vexing parse** rule.
Fortunately, Clang++ warns you that the most vexing parse has been applied.
To force the intended variable initialization, you can use:
- Extra parentheses, `int i((int(n)));`
- Copy-initialization, `int i = int(n);`
- Brace-initialization, `int i{int(n)};`
## Virtual Transitivity
Imagine you have three classes, `C` that inherits from `B` that inherits from `A`.
If a method is made `virtual` in `A`, then it stays virtual all along the inheritance chain without the need to repeat the `virtual` keyword.
The modern best practice is still to use the keyword `override` where your intention is to override a virtual method; this way, if the method wasn't actually virtual, you get an explicit error instead of a silent bug where you accidentally shadowed a method instead.