C++ дайджест #30: Contracts, Preconditions, Invariants, for_each для tuple
Підписуйтеся на Telegram-канал «DOU #tech», щоб не пропустити нові технічні статті
Привіт, мої любі сішники! В цьому випуску матеріали з Preconditions, об’єктів синхронізації, оптимізації та метапрограмування під MSVC.
Modern C++
std::index_sequence and its Improvement in C++20 — for_each для tuple на С++20 від Jonathan Boccara.
12 Different Ways to Filter Containers in Modern C++ — можливості фільтрування контейнерів через предикати з використанням С++20.
Contracts, Preconditions & Invariants — забезпечення цілісності «
контрактів»
(семантичного значення декларування функцій) за допомогою Preconditions та інваріантів.
Preconditions, Part 1, Part 2 — детальний огляд precondition від Herb Sutter: взаємозв’язок з асертами, як імплементувати в С++ 20 та більш ранніх стандартах.
Barriers and Atomic Smart Pointers in C++20 — можливості proposal N4162 до стандарту, у якому вводяться std::atomic_shared_ptr
і std::atomic_weak_ptr
, та відмінності std::latch
від std::barrier
.
std::jthread and cooperative cancellation with stop token — розглянуто std::jthread
з std::stop_token
.
Semaphores in C++20 — на прикладі розглянуто введений у С++ 20 std::binary_semaphore
.
Корисні посилання
Серія статей Creating other types of synchronization objects that can be used with co await: частина 1 — The one-shot event, частина 2 — The basic library, частина 3 — Parallel resumption, частина 4 — The manual-reset event, частина 5 — The auto-reset event, частина 6 — The semaphore, частина 7 — The mutex and recursive, частина 8 — The shared mutex, частина 9 — The shared mutex (continued);
How C++ Resolves a Function Call — детальний опис, як не впасти у депресію, якщо вошлог заполонили помилки серії:
error C2666: 'String::operator ==': 2 overloads have similar conversions note: could be 'bool String::operator ==(const String &) const' note: or 'built-in C++ operator==(const char *, const char *)' note: while trying to match the argument list '(const String, const char *)'
Гарний огляд вибору певної функції компілятором і покроковий туторіал з подолання челенджу.
How to use C++ for Cross-Platform Development — швидке введення в використання С++ для написання кросплатформених застосунків на android/ios/win. Описано базову інтеграцію та взаємодію між мовами (Java (Android) / C++, Objective-C / C++, Swift / C++).
Job related results from the Meeting C++ community survey — статистика від Meeting C++.
Parameter Passing in C and C++ — що ховає під капотом вислів «
передача параметрів»
до рівня асемблеру.
Inlining and Compiler Optimizations — constant propagation та loop-invariant code motion.
Build Throughput Series: Template Metaprogramming Fundamentals та More Efficient Template Metaprogramming — спеціалізація та створення екземплярів шаблонів в MSVC та як оптимізувати час компіляції.
Інструменти
- PVS-Studio 7.12 New Features for Finding Safety and Security Threats
- Registries: Bring your own libraries to vcpkg
- Take control of your vcpkg dependencies with versioning support
- Complete C++20 Modules Support with GCC
- IntelliSense Improvements in Visual Studio 2019
- Cling — Beyond Just Interpreting C++
4 коментарі
Додати коментар Підписатись на коментаріВідписатись від коментарів