C++C++11C++14C++17C++20Learn C++Syntax

What Is An Eligible Copy Assignment Operator In C++?

In a modern C++ IDE, one of the features of its modern is the copy assignment operator that is used with “operator=” to create a new object from an existing one. In this post, we explain an eligible copy assignment operator in C++. What are classes and objects in C++? Classes are defined in C++ using keyword class followed by the name of the class. Classes are the blueprint…
Read more
C++C++11C++14C++17C++20

Where To Find The C++ Standards In 2023?

C++ is a well-established programming language that is supported by a big community for many different computing hardware platforms. The language has a set of standards generally named after the approximate year the standard was adopted, such as C++98, C++11, C++14, C++17…
C++C++17C++20Learn C++Syntax

What Is aligned_alloc In Modern C++?

The C++11 standard introduced a new alignment feature as one of the many features of the C++ programming language that can be used with the newest C++ compilers today. This new feature was a new keyword align std::aligned_alloc that is used to provide a nested type that can be used as an uninitialized storage for any object whose size is at most the given object size by the alignment size…
Read more
C++11C++14C++17Learn C++

The Main Function of a C++ Program

The source code written in C++ must be compiled (i.e. translated to the machine code) by one or another compiler such as Embarcadero RAD Studio C++ compilers before in can be runned. In general, there are two types of the resulting machine code: library and main executable (hereinafter simply executable). This post will briefly cover the later of these two. When an executable produced from a…
Read more
C++11C++14C++17Learn C++

Switch Statement in Modern C++

The C++ language provides the switch statement which can be used to replace the set of if statements (see If Statements in Modern C++). First of all, let’s define the enum type Traffic_light_color as follows: enum class Traffic_light_color { red, yellow, green }; Then, the following snippet: // Snippet 1 #include <stdexcept> #include <string_view> std::string_view…
Read more