From b8254dcf96873c9f2d0012c7cc960fddb755d8bb Mon Sep 17 00:00:00 2001 From: Thibault Kruse Date: Sat, 3 Oct 2015 13:14:52 +0200 Subject: [PATCH] fix mix of tabs and spaces --- CppCoreGuidelines.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index e9a39cd..cdc1c21 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -5297,17 +5297,17 @@ Note that because of language rules, the covariant return type cannot be a smart public: point(int xx, int yy) : x{xx}, y{yy} { } int get_x() { return x; } - void set_x(int xx) { x = xx; } + void set_x(int xx) { x = xx; } int get_y() { return y; } - void set_y(int yy) { y = yy; } - // no behavioral member functions + void set_y(int yy) { y = yy; } + // no behavioral member functions }; Consider making such a class a `struct` -- that is, a behaviorless bunch of variables, all public data and no member functions. struct point { - int x = 0; - int y = 0; + int x = 0; + int y = 0; }; ##### Note @@ -8695,12 +8695,12 @@ make the job of the optimizer much harder. Simple code often optimizes better th ##### Example int matrix[rows][cols]; - + //bad for(int c=0; c p = D::Create(); // creating a D object + shared_ptr p = D::Create(); // creating a D object This design requires the following discipline: @@ -13246,7 +13246,7 @@ Most compilers already warn about simple cases and has the information to do mor { return ...; } - + auto v = get_large_vector(); //return by value is ok, most modern compilers will do copy elision ##### Example