C++C++11C++14C++17C++20IteratorsLearn C++Templates

What Is Atomic (std::atomic) In Modern C++?

In modern C++, the concurrency support library is designed to solve problems in multi-thread operations. This library includes built-in support forthreads (std::thread), atomic operations (std::atomic), mutual exclusion (std::mutex), condition variables (std::condition_variable),and many other features of a modern C++ compiler. In this post, we explain what is std::atomic and how we…
Read more
C++C++11C++14C++17Learn C++Templates

Allowing move constructors to throw with std::move_if_noexcept

In a modern C++ code compiler, there are many features that help you learn, master, and remember the various features and functions of the C++ language. One such feature of modern C++ is the move constructor that allows you to move the resources from one object to another without copying them. The C++11 standard provides an alternative to std::move, which is std::move_if_noexcept, to solve some…
Read more
C++C++11C++14C++17Learn C++Templates

Learn How To Use Non-Copyable Movable Types in C++ Templates

In C++, memory and CPU/GPU management are very important and the compiler is amazingly using them well in templates, classes, and objects. Every declaration and usage of any bits may cause a lot of heavy calculations, memory usage, and high CPU/GPU usage. Using copy and move types in templates is very important when you develop a professional app. In this post, we explain how you can use…
Read more
C++C++11C++14C++17C++20Learn C++

What Is The Explicit Specifier In Modern C++?

In modern C++, explicit-qualified conversion functions work in the same context as explicit-qualified constructors and produce diagnostics in the same contexts as constructors do. C++11, C++17, and C++20 standards have improvements in this explicit specifier. This is done in order to avoid situations when the compiler uncomplainingly accepts code that is not semantically correct. In this post, we…
Read more