| Differences between
and this patch
- Websites/webkit.org/ChangeLog +9 lines
Lines 1-3 Websites/webkit.org/ChangeLog_sec1
1
2016-03-03  Saam barati  <sbarati@apple.com>
2
3
        Update style guide to reflect our style of only using "override" when overriding virtual methods
4
        https://bugs.webkit.org/show_bug.cgi?id=154978
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * code-style.md:
9
1
2016-02-29  Yusuke Suzuki  <utatane.tea@gmail.com>
10
2016-02-29  Yusuke Suzuki  <utatane.tea@gmail.com>
2
11
3
        [DFG][FTL][B3] Support floor and ceil
12
        [DFG][FTL][B3] Support floor and ceil
- Websites/webkit.org/code-style.md -1 / +46 lines
Lines 1187-1190 drawJpg(); // FIXME(joe): Make this code Websites/webkit.org/code-style.md_sec1
1187
1187
1188
```cpp
1188
```cpp
1189
drawJpg(); // TODO: Make this code handle jpg in addition to the png support.
1189
drawJpg(); // TODO: Make this code handle jpg in addition to the png support.
1190
```
1190
```
1191
1192
### Overriding Virtual Methods
1193
1194
[](#override-methods) The base level declaration of a virtual method inside a class must be declared with the `virtual` keyword. All subclasses of that class must specify the `override` keyword when overriding the virtual method.
1195
1196
###### Right:
1197
1198
```cpp
1199
class Person {
1200
public:
1201
    virtual String description() { ... };
1202
}
1203
1204
class Student : public Person {
1205
public:
1206
    String description() override { ... }; // This is correct because it only contains the "override" keyword to indicate that the method is overridden.
1207
}
1208
1209
```
1210
1211
###### Wrong:
1212
1213
```cpp
1214
class Person {
1215
public:
1216
    virtual String description() { ... };
1217
}
1218
1219
class Student : public Person {
1220
public:
1221
    virtual String description() override { ... }; // This is incorrect because it uses both the "virtual" and "override" keywords to indicate that the method is overridden.
1222
}
1223
```
1224
1225
```cpp
1226
class Person {
1227
public:
1228
    virtual String description() { ... };
1229
}
1230
1231
class Student : public Person {
1232
public:
1233
    virtual String description() { ... }; // This is incorrect because it uses the "virtual" keyword to indicate that the method is overridden.
1234
}
1235
```

Return to Bug 154978