Search

0.11 — Configuring your compiler: Warning and error levels

When you write your programs, the compiler will check to ensure you’ve followed the rules of the C++ language (assuming you’ve turned off compiler extensions, as per lesson 0.10 — Configuring your compiler: Compiler extensions).

If you have done something that definitively violates the rules of the language, during compilation the compiler will emit an . . . → Read More: 0.11 — Configuring your compiler: Warning and error levels

0.10 — Configuring your compiler: Compiler extensions

The C++ standard defines rules about how programs should behave in specific circumstances. And in most cases, compilers will follow these rules. However, many compilers implement their own changes to the language, often to enhance compatibility with other versions of the language (e.g. C99), or for historical reasons. These compiler-specific behaviors are called compiler extensions.

. . . → Read More: 0.10 — Configuring your compiler: Compiler extensions

0.5 — Introduction to the compiler, linker, and libraries

Continuing our discussion of this diagram from the previous lesson (0.4 — Introduction to C++ development):

Let’s discuss steps 4-7.

Step 4: Compiling your source code

In order to compile a C++ program, we use a C++ compiler. The C++ compiler sequentially goes through each source code (.cpp) file in your . . . → Read More: 0.5 — Introduction to the compiler, linker, and libraries

B.3 — Introduction to C++17

What is C++17?

In September of 2017, the ISO (International Organization for Standardization) approved a new version of C++, called C++17. C++17 contains a fair amount of new content

New improvements in C++17

For your interest, here’s a list of the major improvements that C++17 adds. Note that this list is not comprehensive, but . . . → Read More: B.3 — Introduction to C++17

Appendix C — The end?

Congratulations! You made it all the way through the tutorials! Take a moment and give yourself a well-deserved (insert something you enjoy here).

Now, after breathing a long sigh of relief, you’re probably asking the question, “What next?”.

What next?

By this point, you should have a solid understanding of the core C++ language. This . . . → Read More: Appendix C — The end?

8.16 — Timing your code

When writing your code, sometimes you’ll run across cases where you’re not sure whether one method or another will be more performant. So how do you tell?

One easy way is to time your code to see how long it takes to run. C++11 comes with some functionality in the chrono library to do just . . . → Read More: 8.16 — Timing your code

B.2 — Introduction to C++14

What is C++14?

On August 18, 2014, the ISO (International Organization for Standardization) approved a new version of C++, called C++14. Unlike C++11, which added a huge amount of new functionality, C++14 is a comparatively minor update, mainly featuring bug fixes and small improvements.

New improvements in C++14

For your interest, here’s a list of . . . → Read More: B.2 — Introduction to C++14

11.6a — Calling inherited functions and overriding behavior

By default, derived classes inherit all of the behaviors defined in a base class. In this lesson, we’ll examine in more detail how member functions are selected, as well as how we can leverage this to change behaviors in a derived class.

Calling a base class function

When a member function is called with a . . . → Read More: 11.6a — Calling inherited functions and overriding behavior

11.6b — Hiding inherited functionality

Changing an inherited member’s access level

C++ gives us the ability to change an inherited member’s access specifier in the derived class. This is done by using a using declaration to identify the (scoped) base class member that is having its access changed in the derived class, under the new access specifier.

For example, consider . . . → Read More: 11.6b — Hiding inherited functionality

6.11a — References and const

Reference to const value

Just like it’s possible to declare a pointer to a const value, it’s also possible to declare a reference to a const value. This is done by declaring a reference using the const keyword.

References to const values are often called “const references” for short.

Initializing references to const values

. . . → Read More: 6.11a — References and const