Skip to content

Commit f58462f

Browse files
committed
Remove trailing whitespace
1 parent 1be918f commit f58462f

11 files changed

+20
-28
lines changed

00-Table_of_Contents.md

-2
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@
1111
10. [Enable Scripting](10-Enable_Scripting.md)
1212
11. [Further Reading](11-Further_Reading.md)
1313
12. [Final Thoughts](12-Final_Thoughts.md)
14-
15-

02-Use_the_Tools_Available.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Use an industry standard widely accepted build tool. This prevents you from rein
3333
* [maiken](https://github.com/Dekken/maiken) - Crossplatform build tool with Maven-esque configuration style.
3434
* [Qt Build Suite](http://doc.qt.io/qbs/) - Crossplatform build tool From Qt.
3535
* [meson](http://mesonbuild.com/index.html) - Open source build system meant to be both extremely fast, and, even more importantly, as user friendly as possible.
36-
* [premake](https://premake.github.io/)
36+
* [premake](https://premake.github.io/)
3737
* [xmake](https://xmake.io) - A cross-platform build utility based on Lua. Modern C/C++ build tools, Support multi-language hybrid compilation
3838

3939
Remember, it's not just a build tool, it's also a programming language. Try to maintain good clean build scripts and follow the recommended practices for the tool you are using.
@@ -340,7 +340,7 @@ MSVC's [Control Flow Guard](https://msdn.microsoft.com/en-us/library/windows/des
340340

341341
### Heap Profiling
342342

343-
* [Memoro](https://epfl-vlsc.github.io/memoro/) - A detailed heap profiler
343+
* [Memoro](https://epfl-vlsc.github.io/memoro/) - A detailed heap profiler
344344

345345
## Ignoring Warnings
346346

@@ -410,6 +410,6 @@ Don't forget to make sure that your error handling is being tested and works pro
410410

411411
[pahole](https://linux.die.net/man/1/pahole) generates data on holes in the packing of data structures and classes in compiled code. It can also the size of structures and how they fit within the system's cache lines.
412412

413-
### BinSkim
413+
### BinSkim
414414

415-
[BinSkim](https://github.com/Microsoft/binskim) is a binary static analysis tool that provides security and correctness results for Windows Portable Executable and *nix ELF binary formats
415+
[BinSkim](https://github.com/Microsoft/binskim) is a binary static analysis tool that provides security and correctness results for Windows Portable Executable and *nix ELF binary formats

03-Style.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ It also makes it possible to have two separate files next to each other on one s
240240
```
241241

242242
## Initialize Member Variables
243-
...with the member initializer list.
243+
...with the member initializer list.
244244

245245
For POD types, the performance of an initializer list is the same as manual initialization, but for other types there is a clear performance gain, see below.
246246

@@ -288,8 +288,8 @@ private:
288288
};
289289

290290
// Good Idea
291-
// The default constructor for m_myOtherClass is never called here, so
292-
// there is a performance gain if MyOtherClass is not is_trivially_default_constructible.
291+
// The default constructor for m_myOtherClass is never called here, so
292+
// there is a performance gain if MyOtherClass is not is_trivially_default_constructible.
293293
class MyClass
294294
{
295295
public:
@@ -454,4 +454,3 @@ The Rule of Zero states that you do not provide any of the functions that the co
454454
The goal is to let the compiler provide optimal versions that are automatically maintained when more member variables are added.
455455

456456
[This article](http://www.nirfriedman.com/2015/06/27/cpp-rule-of-zero/) provides a background and explains techniques for implementing nearly 100% of the time.
457-

04-Considering_Safety.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public:
3434
* Always return by value.
3535

3636

37-
references: https://github.com/lefticus/cppbestpractices/issues/21 https://twitter.com/lefticus/status/635943577328095232
37+
references: https://github.com/lefticus/cppbestpractices/issues/21 https://twitter.com/lefticus/status/635943577328095232
3838

39-
### Do not pass and return simple types by const ref
39+
### Do not pass and return simple types by const ref
4040

4141
```cpp
4242
// Very Bad Idea
@@ -47,7 +47,7 @@ public:
4747
: m_int_value(t_int_value)
4848
{
4949
}
50-
50+
5151
const int& get_int_value() const
5252
{
5353
return m_int_value;
@@ -69,7 +69,7 @@ public:
6969
: m_int_value(t_int_value)
7070
{
7171
}
72-
72+
7373
int get_int_value() const
7474
{
7575
return m_int_value;
@@ -101,7 +101,7 @@ auto mybuffer = std::make_unique<char[]>(length); // C++14
101101
auto mybuffer = std::unique_ptr<char[]>(new char[length]); // C++11
102102

103103
// or for reference counted objects
104-
auto myobj = std::make_shared<MyClass>();
104+
auto myobj = std::make_shared<MyClass>();
105105

106106
// ...
107107
// myobj is automatically freed for you whenever it is no longer used.
@@ -111,7 +111,7 @@ auto myobj = std::make_shared<MyClass>();
111111

112112
Both of these guarantee contiguous memory layout of objects and can (and should) completely replace your usage of C-style arrays for many of the reasons listed for not using bare pointers.
113113

114-
Also, [avoid](http://stackoverflow.com/questions/3266443/can-you-use-a-shared-ptr-for-raii-of-c-style-arrays) using `std::shared_ptr` to hold an array.
114+
Also, [avoid](http://stackoverflow.com/questions/3266443/can-you-use-a-shared-ptr-for-raii-of-c-style-arrays) using `std::shared_ptr` to hold an array.
115115

116116
## Use Exceptions
117117

05-Considering_Maintainability.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Know and understand the existing C++ standard algorithms and put them to use.
3333
3434
* See [cppreference](https://en.cppreference.com/w/cpp/algorithm)
3535
* Watch [C++ Seasoning](https://www.youtube.com/watch?v=qH6sSOr-yk8)
36-
36+
3737
Consider a call to `[]` as a potential code smell, indicating that an algorithm was not used where it could have been.
3838
3939

08-Considering_Performance.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ For more examples see [this article](http://blog2.emptycrate.com/content/templat
4343

4444
### Avoid Recursive Template Instantiations
4545

46-
Recursive template instantiations can result in a significant load on the compiler and more difficult to understand code.
46+
Recursive template instantiations can result in a significant load on the compiler and more difficult to understand code.
4747

4848
[Consider using variadic expansions and folds when possible instead.](http://articles.emptycrate.com/2016/05/14/folds_in_cpp11_ish.html)
4949

@@ -289,11 +289,11 @@ if (MyObject obj(index); obj.good()) {
289289
290290
### Prefer `double` to `float`, But Test First
291291
292-
Depending on the situation and the compiler's ability to optimize, one may be faster over the other. Choosing `float` will result in lower precision and may be slower due to conversions. On vectorizable operations `float` may be faster if you are able to sacrifice precision.
292+
Depending on the situation and the compiler's ability to optimize, one may be faster over the other. Choosing `float` will result in lower precision and may be slower due to conversions. On vectorizable operations `float` may be faster if you are able to sacrifice precision.
293293
294294
`double` is the recommended default choice as it is the default type for floating point values in C++.
295295
296-
See this [stackoverflow](http://stackoverflow.com/questions/4584637/double-or-float-which-is-faster) discussion for some more information.
296+
See this [stackoverflow](http://stackoverflow.com/questions/4584637/double-or-float-which-is-faster) discussion for some more information.
297297
298298
### Prefer `++i` to `i++`
299299
... when it is semantically correct. Pre-increment is [faster](http://blog2.emptycrate.com/content/why-i-faster-i-c) than post-increment because it does not require a copy of the object to be made.
@@ -313,7 +313,7 @@ for (int i = 0; i < 15; ++i)
313313
```
314314

315315
Even if many modern compilers will optimize these two loops to the same assembly code, it is still good practice to prefer `++i`. There is absolutely no reason not to and you can never be certain that your code will not pass a compiler that does not optimize this.
316-
You should be also aware that the compiler will not be able optimize this only for integer types and not necessarily for all iterator or other user defined types.
316+
You should be also aware that the compiler will not be able optimize this only for integer types and not necessarily for all iterator or other user defined types.
317317
The bottom line is that it is always easier and recommended to use the pre-increment operator if it is semantically identical to the post-increment operator.
318318

319319
### Char is a char, string is a string
@@ -353,4 +353,3 @@ Properly use the already highly optimized components of the vendor provided stan
353353
#### `in_place_t` And Related
354354
355355
Be aware of how to use `in_place_t` and related tags for efficient creation of objects such as `std::tuple`, `std::any` and `std::variant`.
356-

09-Considering_Correctness.md

-2
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,3 @@ Consider using a typesafe library like
2626
Note that stronger typing can also allow for more compiler optimizations.
2727

2828
* [Sorting in C vs C++](Sorting in C vs C++.pdf)
29-
30-

11-Further_Reading.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## C++
66

7-
* https://github.com/isocpp/CppCoreGuidelines The C++ Core Guidelines are a set of tried-and-true guidelines, rules, and best practices about coding in C++
7+
* https://github.com/isocpp/CppCoreGuidelines The C++ Core Guidelines are a set of tried-and-true guidelines, rules, and best practices about coding in C++
88
* https://www.gitbook.com/book/alexastva/the-ultimate-question-of-programming-refactoring-/details - The Ultimate Question of Programming, Refactoring, and Everything
99
* http://llvm.org/docs/CodingStandards.html - LLVM Coding Standards - very well written
1010
* http://geosoft.no/development/cppstyle.html

12-Final_Thoughts.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# Final Thoughts
22

33
Expand your horizons and use other programming languages. Other languages have different constructs and expressions. Learning what else is out there will encourage you to be more creative with your C++ and write cleaner, more expressive code.
4-

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License.
1+
This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License.
22
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/.

SUMMARY.md

-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@
1212
* [Enable Scripting](10-Enable_Scripting.md)
1313
* [Further Reading](11-Further_Reading.md)
1414
* [Final Thoughts](12-Final_Thoughts.md)
15-

0 commit comments

Comments
 (0)