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
C++C++14C++17IteratorsLearn C++

What Are The New Begin End Iterators In C++14?

Iterators are one of the most useful features of containers in modern C++. Mostly we use them with vectors, maps, strings, and other containers of C++. In C++11, the begin() and end() iterators are used to define the start of iteration and the end of the iteration, mostly used in the for loops. In C++14, there are new additions to the global std::begin – std::end functions, and in this…
Read more
C++C++11C++14C++17C++20IteratorsLearn C++Syntax

How To Use Functor Object With std::thread In C++?

In modern C++ development we can use multi-thread operations and parallel programming features in our applications in different ways of modern programming features. The std::thread class is a special class defined in <thread> header in the concurrency support library that comes with C++11. We can use the std::thread class in multi-thread operations with functor objects, and in this post…
Read more