[Libreoffice-commits] online.git: wsd/README

Miklos Vajna vmiklos at collabora.co.uk
Wed Feb 7 14:37:09 UTC 2018


 wsd/README |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
commit 35ccd70681ea3220ec33a19efa41575c4df8bcb2
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Feb 7 14:58:23 2018 +0100

    wsd: document when to use 'auto'
    
    Change-Id: I376c8d159bc8e087315de29fd3289b45b36d4b76
    Reviewed-on: https://gerrit.libreoffice.org/49356
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/wsd/README b/wsd/README
index c696a42c..cb52706f 100644
--- a/wsd/README
+++ b/wsd/README
@@ -391,3 +391,14 @@ The style is roughly as follows, in rough order of importance:
 
 - return - is not a function; but a statement - it doesn't need extra ()
 
+- Use 'auto' in the following cases only:
+
+  - iterators
+
+  - range-based for loops
+
+  - the type is spelled out in the same line already (e.g. initializing from a
+    cast or a function that has a single type parameter)
+
+  In other cases it makes the code more readable to still spell out the type
+  explicitly.


More information about the Libreoffice-commits mailing list