[PATCH v2] Add info to the CodingStyle for C++ constructors

Thiago Macieira thiago at macieira.org
Wed Jan 22 08:25:14 UTC 2014


Signed-off-by: Thiago Macieira <thiago at macieira.org>
---
 CodingStyle | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/CodingStyle b/CodingStyle
index 82c86e5..95fb610 100644
--- a/CodingStyle
+++ b/CodingStyle
@@ -50,6 +50,14 @@
 	b = a + (c + d +
 		 f + z);
 
+- in a C++ constructor initialization list, the colon is on the same line and
+  continuation lines are aligned as the rule above:
+
+	ClassName::ClassName() : x(1), y(2),
+				 z(3)
+	{
+	}
+
 - unfortunate inconsistency:
   -- C code usually uses underscores to structure names
 
@@ -74,4 +82,4 @@
 		for (i = 0; i < 5; i++)
 			do_something(i);
 	}
-	}
\ No newline at end of file
+	}
-- 
1.7.11.7



More information about the subsurface mailing list