diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2013-02-04 10:24:58 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2013-02-04 10:24:58 +0000 |
commit | a84c59c95affec29f93fe6f239985725ee16ac99 (patch) | |
tree | 814f6da1c4665c088759f5b3d3493f1438a2744b /llvm/docs | |
parent | 2c5cbd2b387f67d74fe08f9a3df163186b156e67 (diff) | |
download | bcm5719-llvm-a84c59c95affec29f93fe6f239985725ee16ac99.tar.gz bcm5719-llvm-a84c59c95affec29f93fe6f239985725ee16ac99.zip |
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() {
// ...
}
};
llvm-svn: 174317
Diffstat (limited to 'llvm/docs')
-rw-r--r-- | llvm/docs/CodingStandards.rst | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/docs/CodingStandards.rst b/llvm/docs/CodingStandards.rst index 74289a8a445..4d66ad75743 100644 --- a/llvm/docs/CodingStandards.rst +++ b/llvm/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 ------------------- |