What Are The Useful Mutex, Shared Mutex and Tuple Features In Modern C++
Hello C++ Developers, Embarcadero and Whole Tomato developer teams are working hard on to release of RAD Studio 12, and it seems like we may (or not) see the early released version of the new C++ compiler before 2024. The new 64-bit Clang Toolchain in RAD Studio 12 may have a new bcc64x C++ compiler. The news is amazing. Before it comes, let’s keep learning some modern C++ features to heat up from now on. This week, we have 3 more modern C++ features that can be used in C++ Builder. The concurrency support library in modern C++ is designed to allow your programs to read and write data securely in thread operations allowing us to develop faster multi-thread code. There are differences between mutual exclusion (std::mutex) and shared mutex (std::shared_mutex) and in another post, we explain these. The tuple (std::tuple) was introduced in C++11 and improved in C++14. In the last post, we explain tuple addressing via type features that come with the C++14 standard. Our educational LearnCPlusPlus.org site has a broad selection of new and unique posts with examples suitable for everyone from beginners to professionals alike. It is growing well thanks to you, and we have many new readers, thanks to your support! The site features a treasure-trove of posts that are great for learning the features of modern C++ compilers with very simple explanations and examples. RAD Studio’s C++ Builder, Delphi, and their free community editions C++ Builder CE, and Delphi CE are powerful tools for modern application development. Table of Contents Do you want to know some news about C++ Builder 12? How to use modern C++ with C++ Builder? How to learn modern C++ for free using C++ Builder? Where I can I learn C++ and test these examples with a free C++ compiler? Do you want to know some news about C++ Builder 12? RAD Studio, C++ Builder 12 may come with a new C++ compiler that has 64bits Windows CLANG 15.x based compiler. If you want to discover what’s coming in the next RAD Studio 12. Secure your spot from this link now: https://ow.ly/NZFQ50PVL13 Some of the technical features are: Uses Clang 15 Uses LLVM’s lld as the linker Emits COFF64 object files (note this means Delphi can also emit COFF64 object files in 12.0: the compiler option “-jf:coff” is specified by our targets files when the “-JL” or “-JPHN[E]” options are specified) Emits PDB format debug info Uses the Itanium ABI (not Microsoft ABI) Uses LLVM’s libc++ STL Uses UCRT for the C runtime Uses a mix of LLVM and MinGW for the C++ runtime Targets Win64 Named bcc64x Here are more details about it, Win64 Clang Toolchains in RAD Studio 12 How to use modern C++ with C++ Builder? In modern C++, the concurrency support library is designed to solve read and write data securely in thread operations that allow us to develop faster multi-thread apps. 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 the class located in header. In the first post, we explain using shared mutexes locking in Modern C++. There are differences between mutual exclusion (std::mutex) which comes with C++11 and shared mutex (std::shared_mutex) which comes with C++14 standards. In the next post, we explain a frequently asked mutex question in modern C++, what are […]
