C++C++11C++14C++17C++20Game DevelopmentIntroduction to C++Learn C++Syntax

What Is The mt19937 Random Generator In Modern C++?

Random numbers are one of the most important parts of today’s modern programming technologies. They are used in mathematics, physics, in many engineering fields, and in programming such as generating random data for testing, random maps in levels, random trees on a planet – the list is endless. Since C++11, mt19937 (std::mt19937) is implemented as a random number generator. In this…
Read more
C++C++17Learn C++Syntax

What Is The New std::sample Algorithm In C++ 17?

The C++ 17 standard bring us a lot of useful methods, templates and algorithms. One of the great algorithms is std::sample defined in the <algorithm> header that samples at most n elements uniformly from a given range. In this post, we explain the std::sample algorithm and how we can use it with an mt19937 random generator. What is the std::sample algorithm in C++ 17 and beyond? The…
Read more
C++C++17C++20IteratorsLearn C++Syntax

What Are The New Algorithms That Come With C++ 17?

The C++17 standard came with a lot of new features and improvements. One of the features was the math.h library which modernized math operations with the cmath library. The Parallelism Technical Specification adds several new algorithms to the standard C++ library that we can use in C++ Builder 12. These are modernized in the <algorithm> header in the standard library. In this post, we…
Read more
C++C++14C++17Learn C++Syntax

What Are The New Overloads For Ranges In C++ 14?

In C++14, there are pretty good new overloads of std::equal, std::mismatch, and std::is_permutation that can be used to take a pair of iterators for the second range. They can be used with the new C++ Builder 12 along with the 11.x, or 10.x versions too. In this post, we explain these new overloads that we use ranges of iterations. What are the new overloads for ranges in C++ 14? In…
Read more