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

Learn To Use Generalized Lambda Captures In C++

The Lambda Expression construct is introduced in C++ 11 and further developed in the C++14, C++17, and C++20 standards. C++14 standard introduced thegeneralized lambda capture (init capture) that allows you to specify generalized captures, it allows to use move capture in lambdas. In C++14, lambda expressions are improved by the generalized lambda (generic lambda) and by this generalized…
Read more
C++C++11C++14C++17C++20Learn C++

Learn The Useful Integer Literals In Modern C++

A programming language consists of a lot of expressions in our source code. One of elements of expressions in C++ are literals. A more specific type of literal is Integer Literals. Integer literals are primary expressions that allow values of integer types (i.e., decimal, octal, hexadecimal) to be used in expressions directly. They are further improved by the boolean literals (binary digits) in…
Read more
C++C++11C++14C++17C++20Learn C++

How to Use Atomic_flag In Modern C++?

C++11 allows the use of atomics in signal handlers. In C++17 the signal handler feature is further improved. The std::atomic_flag is an atomic boolean type that is guaranteed to be lock-free and can be used in signal handlers. Moreover, the <csignal> header in C++ has an integer type std::sig_atomic_t that can be accessed as an atomic entity even in the presence of asynchronous…
Read more
C++C++11C++14C++17C++20Learn C++Syntax

Learn Strong Compare and Exchange In Modern C++

Since the C++11 standard, the Concurrency Support Library includes built-in support for threads (std::thread) with atomic operations (std::atomic). C++11 provides both weak and strong compare-and-exchange operations in multi-threading applications. Since C++11, strong compare and exchange are used in modern C++ standards such as C++14, C++17, C++20, and in other new standards. In this post, we…
Read more