C++C++17ComponentsGame DevelopmentLanguage FeatureLearn C++

Learn To Create A Torus As A Custom 3D Mesh Object in C++ Builder

In a 3D Application Development, 3D objects can be displayed with 2D projection methods by using 2D / 3D mathematical calculations drawings. That may be hard to code and needs much coding skills to display them. We can use OpenGL and DirectX with their 3D functions/commands to display them. We can also use and port a 3D Engine SDK. In C++ Builder, 3D objects can be easily displayed by using…
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
C++C++17C++20Learn C++Templates

How To Use std::invoke In C++ 17?

There is a new library feature in the C++17 standard, it is std::invoke which is a useful feature to uniformly invoke callable entities. In this post, we explain what std::invoke is and how we can use it in examples. First, let’s remind ourselves about what is a callable object and what is a functor in modern C++. What is callable object and what is functor in modern…
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