aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2013-02-04 10:24:58 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2013-02-04 10:24:58 +0000
commitb7978cf7010f6874c9648fbecd56fbed5236ff51 (patch)
treefbeec06c426b0c97c088bd006ab5a9652570b42a /docs
parent6c440fcea52e27b3befcf2ad5f7dcc58a15a2e58 (diff)
Coding standards: don't use ``inline`` when defining a function in a class
definition Current practice is not to use 'inline' in: class Foo { public: inline void bar() { // ... } }; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174317 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/CodingStandards.rst28
1 files changed, 28 insertions, 0 deletions
diff --git a/docs/CodingStandards.rst b/docs/CodingStandards.rst
index 74289a8a44..4d66ad7574 100644
--- a/docs/CodingStandards.rst
+++ b/docs/CodingStandards.rst
@@ -1088,6 +1088,34 @@ flushes the output stream. In other words, these are equivalent:
Most of the time, you probably have no reason to flush the output stream, so
it's better to use a literal ``'\n'``.
+Don't use ``inline`` when defining a function in a class definition
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+A member function defined in a class definition is implicitly inline, so don't
+put the ``inline`` keyword in this case.
+
+Don't:
+
+.. code-block:: c++
+
+ class Foo {
+ public:
+ inline void bar() {
+ // ...
+ }
+ };
+
+Do:
+
+.. code-block:: c++
+
+ class Foo {
+ public:
+ void bar() {
+ // ...
+ }
+ };
+
Microscopic Details
-------------------