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

Learn How to Use New And Delete Elisions In C++

The C++14 standard (and later), brings a lot of useful smart pointers and improvements on them. They help us to avoid the mistake of incorrectly freeing the memory addressed by pointers. In modern C++, we have the new and delete operators that are used to allocate and free objects from memory, and in this post, we explain how to use new and delete operators. Can we use new and delete elisions…
Read more
C++C++14C++17C++20Learn C++

How To Use std::exchange In C++

C++ is a very precise programming language that allows you to use memory operations in a wide variety of ways. Mastering efficient memory handling will improve your app performance at run time and can result in faster applications that have optimal memory usage. One of the…
C++C++14C++17C++20Learn C++Syntax

What Are The Relaxed Constexpr Restrictions In C++?

In C++, the constexpr specifier is used to declare a function or variable to evaluate the value of at compile time, which speeds up code during runtime. This useful property had some restrictions in C++11, these are relaxed in C++14 and this feature is known asRelaxed Constexpr Restrictions. In this post, we explain what are the relaxed constexpr restrictions in modern C++. What is the…
Read more
C++C++14C++17C++20Learn C++

What Is Auto Return Type Deduction In C++?

C++11 allowed lambda functions to deduce the return type based on the type of the expression given to the return statement. The C++14 standard provides return type deduction in all functions, templates, and lambdas. C++14 allows return type deduction for functions that are not of the form return expressions. In this post, we explain the auto keyword, what is an auto type deduction, and how we…
Read more
C++C++14C++17C++20Learn C++

What Does Deprecated Mean And How To Use Deprecated Attribute In C++?

C++ is very strong in every aspect of modern programming and evolves and refines itself even further with the release of each new C++ standard. While there are many new additions there are some features that are found not useful or dangerous in programming, thus the community offers its deprecation in the next standard and then it is generally removed in the following standard. C++14 came with a…
Read more