From 7248e4026e4e5f1fd7329db3f27af4b14c2ec919 Mon Sep 17 00:00:00 2001 From: elvez Date: Tue, 24 Jan 2006 17:39:24 +0000 Subject: [PATCH] Modified sgpem2dman.texi: -Adjusted some code snippets whose style was inconsistent -Added an item for operator overloading git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@187 3ecf2c5c-341e-0410-92b4-d18e462d057c --- doc/sgpem2dman.texi | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/doc/sgpem2dman.texi b/doc/sgpem2dman.texi index 275d336..d05507c 100644 --- a/doc/sgpem2dman.texi +++ b/doc/sgpem2dman.texi @@ -90,6 +90,11 @@ Free Documentation License''. @table @strong +@item 2006, January 24th, @r{--- Luca Vezzaro} +Updated some code snippets whose style were +inconsistent with our coding rules. Added the point on +operator overloading to the coding conventions. + @item 2005, December 26th, @r{--- Matteo Settenvini} Changed directory layout for @samp{src}. Added @samp{swe/prototypes} to repository layout. @@ -309,7 +314,8 @@ Labels go indented on the same level of the containing code block. For example: @example @verbatim -switch(x) { +switch(x) +{ case 1: // foo case 2: @@ -332,7 +338,8 @@ documenting it. For example: class C; // [...] -class C { +class C +{ public: // [...] }; @@ -546,12 +553,14 @@ containing class. For example: @verbatim class C; -class C { +class C +{ class D; // ... }; -class C::D { +class C::D +{ // ... }; @end verbatim @@ -559,6 +568,19 @@ class C::D { The order for visibility should be: @code{public}, then @code{protected}, then @code{private}. +@item +Use operator overloading with care, only define +overloaded operators if the use of that operator is a +natural way to perform a particular operation on the +object(s). +In case operator overloading is considered the +best choice, a lot of operators should still be avoided +due to their profound integration with the language, +and their tendency to lead to ugly bugs. Some +examples of these operators are: the casting operator, +@code{operator delete}, @code{operator new}, +@code{operator ^}. + @end enumerate