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

What Is The Explicit Specifier In Modern C++?

In modern C++, explicit-qualified conversion functions work in the same context as explicit-qualified constructors and produce diagnostics in the same contexts as constructors do. C++11, C++17, and C++20 standards have improvements in this explicit specifier. This is done in order to avoid situations when the compiler uncomplainingly accepts code that is not semantically correct. In this post, we…
Read more
C++C++11C++14C++17C++20Introduction to C++IteratorsLearn C++Syntax

What is a range-based for loop in modern C++?

In C++, the for loops are one of the great features of C and C++ language that has many options to break, continue, or iterate in a loop. In modern C++, there is a range-based for loop that makes it simple to iterate through a variable type that has members (i.e. strings, lists, arrays, vectors, maps, etc.). The range-based for loop is a feature for the for() loops introduced by the C++11…
Read more
C++C++11C++14C++17C++20Introduction to C++Learn C++Syntax

Learn How To Use The Final Specifier In Modern C++

Modern C++ has many additions compared to the original C++ standard. Regarding virtual overrides, C++11 tends to tighten the rules, to detect some problems that often arise. To achieve this goal C++11 introduces two new contextual keywords, the final and the override. The final specifier (keyword) is used for a function or for a class that cannot be derived and overridden by derived classes. This…
Read more
C++C++11C++14C++17C++20Introduction to C++Learn C++Syntax

What Is An Extended sizeof In Modern C++?

In modern programming, the size of any data is very important, while the programmers are trying to minimize data types or stream packages, global data transfer is increasing by the requests of new technologies. Thus, we need to know each data type in programming. The sizeof() function is very useful to get the size of variables in bytes. C++11 extends the functionality of sizeof function so that…
Read more