Skip to content

Commit 12a2fd1

Browse files
author
Pavel Kovalenko
committed
Update conventions (add rule for virtual function overriding).
1 parent 5edf937 commit 12a2fd1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

doc/procedure/cpp_code.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,22 @@ Casing styles:
433433
- Global variables: PascalCase
434434
- Namespaces: PascalCase
435435

436+
When overriding virtual function, use override specifier on function declaration.
437+
BAD
438+
class Server : public IServer
439+
{
440+
...
441+
virtual void OnClientConnected(IClient* client);
442+
...
443+
};
444+
GOOD
445+
class Server : public IServer
446+
{
447+
...
448+
virtual void OnClientConnected(IClient* client) override;
449+
...
450+
};
451+
436452
Checking function return values:
437453
Functions that return bool or a pointer will be checked without
438454
comparing, if they return true or false.

0 commit comments

Comments
 (0)