C++C++17C++20Introduction to C++Language FeatureLearn C++Syntax

Learn How To Use Clamp (std::clamp) In Modern C++ 17 and Beyond

The C++17 brings a lot of features to the modern programming. The Parallelism Technical Specification adds several new algorithms to the standard C++ library. These are modernized in the <algorithm> header in the standard library. In this library there is a very less know useful algorithm std::clamp, which is an algorithm that returns value in its range. In this post, we explain what is…
Read more
C++C++11C++14C++17C++20Learn C++Syntax

What Is The disjunction (std::disjunction) Metafunction In C++?

Metaprogramming is another great feature of modern C++ that allows programs to redesign themselves during compilation or run time. In C++17, another new feature of metaprogramming is introduced, logical operation metafunctions. These are variadic metafunctions that are conjunction, disjunction, and negation which can be used for metaprogramming features of applications. In this post, we explain…
Read more
C++C++11C++14C++17C++20Learn C++Syntax

What Is Set (std::set) In Modern C++?

Modern C++ has a lot of options to add and modify data members with its amazing data holders, arrays, structs, pointers, and containers. Containers are powerful data storage arrays in C++ and they are very useful to iterate and search. A container is a holder object that stores data elements (a collection of data objects). std::array, std::vector, and std::map are these kinds of containers.
Read more
C++C++11C++14C++17C++20Introduction to C++IteratorsLearn C++Syntax

What Are The Differences Between std::rand() And std::mt19937 In Modern C++?

Random numbers are widely used in today’s modern applications. In C we use rand(), srand() and in C++ it is std::rand(), std::srand(). Since C++11, we can use the Mersenne Twister random generators;  mt19937 (std::mt19937) for 32-bit applications and mt19937_64 (std::mt19937_64) for 64-bit applications. Modern C++ allows us to use both old and new random generators. In this post, we explain…
Read more