Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
477c4eda
Unverified
Commit
477c4eda
authored
6 years ago
by
Gigg, Martyn Anthony
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update CPPStandards.rst
Remove out of date statement
parent
7b2878bb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dev-docs/source/Standards/CPPStandards.rst
+4
-8
4 additions, 8 deletions
dev-docs/source/Standards/CPPStandards.rst
with
4 additions
and
8 deletions
dev-docs/source/Standards/CPPStandards.rst
+
4
−
8
View file @
477c4eda
...
@@ -280,20 +280,16 @@ Expressions and Statements
...
@@ -280,20 +280,16 @@ Expressions and Statements
with side effects as the right-operand of ``&&`` or ``||``. Any such
with side effects as the right-operand of ``&&`` or ``||``. Any such
instances must be commented in detail to alert other developers to
instances must be commented in detail to alert other developers to
the fact that the function is not always called.
the fact that the function is not always called.
4. ``for`` and ``while`` loops should not use ``break`` and
4. A ``for`` loop should only have one control variable, and should
``continue`` where they can be avoided. Where they are required,
comments should draw attention to them as an alternative exit point
from the loop.
5. A ``for`` loop should only have one control variable, and should
not modify it in the body.
not modify it in the body.
6
. ``switch`` statements must include a ``default`` clause, even if
5
. ``switch`` statements must include a ``default`` clause, even if
only to catch errors.
only to catch errors.
7
. Each ``case`` of a ``switch`` statement must either end with a
6
. Each ``case`` of a ``switch`` statement must either end with a
``break``/``return``, or contain a clear comment to alert other
``break``/``return``, or contain a clear comment to alert other
developers to the fact that execution will fall through to the next
developers to the fact that execution will fall through to the next
case. Multiple ``case`` labels (with no code between them) are,
case. Multiple ``case`` labels (with no code between them) are,
however, permitted for the same block of code.
however, permitted for the same block of code.
8
. ``goto`` must be avoided. When there is a need to break out of two
7
. ``goto`` must be avoided. When there is a need to break out of two
or more nested loops in one go, the loops should be moved to a
or more nested loops in one go, the loops should be moved to a
separate function where 'return' can be used instead.
separate function where 'return' can be used instead.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment