X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FCodingStandards.rst;h=4d66ad75743541f3baeaa2cdd6bef251517c61c5;hb=12fa02841ca1f2115d38aadd3e5d7afe08c65337;hp=6377763d8dbd6fe72f157e8821ad2d8bcea00fcb;hpb=a7aec400a7014edba1eeb53c582d3ab47178fe8d;p=oota-llvm.git diff --git a/docs/CodingStandards.rst b/docs/CodingStandards.rst index 6377763d8db..4d66ad75743 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 ------------------- @@ -1302,7 +1330,7 @@ namespace just because it was declared there. See Also ======== -A lot of these comments and recommendations have been culled for other sources. +A lot of these comments and recommendations have been culled from other sources. Two particularly important books for our work are: #. `Effective C++