mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
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
This commit is contained in:
parent
6c440fcea5
commit
b7978cf701
@ -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
|
||||
-------------------
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user