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

Learn About Useful Shared Mutexes Locking In Modern C++

A concurrency support library is designed to solve problems in modern C++ that arise with multi-thread development. This library includes built-in support for threads (std::thread), atomic operations (std::atomic), mutual exclusion (std::mutex), condition variables (std::condition_variable), and many other features. In C++14, in addition to mutex, there is a shared_mutex which is an instance of…
Read more
C++C++14C++17C++20Learn C++Syntax

What Is std::quoted Quoted String In Modern C++?

Sometimes we want to preserve the string format especially when we use string in a string with /”. In C++14 and above, there is a std::quoted template that allows handling strings safely where they may contain spaces and special characters and it keeps their formatting intact. In this post, we explain std::quoted quoted strings in modern C++. What Is Quoted String In Modern…
Read more
C++C++14C++17C++20Learn C++Syntax

What Are The Relaxed Constexpr Restrictions In C++?

In C++, the constexpr specifier is used to declare a function or variable to evaluate the value of at compile time, which speeds up code during runtime. This useful property had some restrictions in C++11, these are relaxed in C++14 and this feature is known asRelaxed Constexpr Restrictions. In this post, we explain what are the relaxed constexpr restrictions in modern C++. What is the…
Read more
C++C++14C++17C++20Learn C++

What Is Auto Return Type Deduction In C++?

C++11 allowed lambda functions to deduce the return type based on the type of the expression given to the return statement. The C++14 standard provides return type deduction in all functions, templates, and lambdas. C++14 allows return type deduction for functions that are not of the form return expressions. In this post, we explain the auto keyword, what is an auto type deduction, and how we…
Read more