Skip to content

Commit

Permalink
Update conventions (add rule for virtual function overriding).
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Kovalenko committed Oct 11, 2014
1 parent 5edf937 commit 12a2fd1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions doc/procedure/cpp_code.txt
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,22 @@ Casing styles:
- Global variables: PascalCase
- Namespaces: PascalCase

When overriding virtual function, use override specifier on function declaration.
BAD
class Server : public IServer
{
...
virtual void OnClientConnected(IClient* client);
...
};
GOOD
class Server : public IServer
{
...
virtual void OnClientConnected(IClient* client) override;
...
};

Checking function return values:
Functions that return bool or a pointer will be checked without
comparing, if they return true or false.
Expand Down

0 comments on commit 12a2fd1

Please sign in to comment.