Тёмный

What Classes We Design and How - Peter Sommerlad - CppCon 2021 

CppCon
Подписаться 153 тыс.
Просмотров 6 тыс.
50% 1

cppcon.org/
github.com/Cpp...
---
C++ class design has been error prone since the beginning until Scott Meyers told us about the Rule-of-Three. But even that is not enforced by the language. In addition, C++11 changed the set of compiler-provided special member functions and the intrinsic rules have become more complicated. However, instead of starting from the rules for special member functions, we will look at what role a class type plays and how that maps on what special member functions to define and how, if any. Examples for class roles are Value, Relationship, Manager (scoped, unique, general), Mix-in.
We will also look at the roles of member variable types that influence or imply the role of the class type.
The role of a class will also take out many mysteries of move operations and will lead to clear guidance when and how to implement move: for suppressing copying, for managing unique ownership (Unique Manager) or for optimizing object copies (General Manager).
We will rehearse the Rule of Zero, and learn more about the Rule of Five/Six, the Rule of DesDeMovA, and the Rule of Unique Three.
This all will enable you to much more consciously and safely design your class types and combine types of member variables. You will have then the ability to select from a few reasonable combinations from the plethora of possibilities of special member function combinations: {public:,protected:,private:} x {destructor, default constructor, copy constructor, copy assignment, move constructor, assignment} x {noexcept(true),noexcept(false)} x { =default, =delete, {/*body*/}, not declared } (math as homework)
---
Peter Sommerlad
Peter Sommerlad was director of IFS Institute for Software at FHO/HSR Rapperswil, Switzerland. Peter is co-author of the books POSA Vol.1 and Security Patterns and contributed to "97 things every programmer should know". His goal is to make software simpler and safer by Decremental Development: Refactoring software down to 10% its size with better architecture, testability and quality and functionality. To reach that goal his team and students created the C++ IDE Cevelop. Peter is a member of MISRA-C++, Hillside, ACM, IEEE Computer Society, SI, ACCU, and the ISO C++ standardization committee.
---
Videos Streamed & Edited by Digital Medium: online.digital-...
Register Now For CppCon 2022: cppcon.org/reg...

Опубликовано:

 

1 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 4   
@Roibarkan
@Roibarkan 2 года назад
01:04:15 I think this might be a version of Sean Parent’s talk that Peter is referring to: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-QGcVXgEVMJg.html
@nmmm2000
@nmmm2000 2 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-iLpt23V2vQE.html move constructor often be implemented by simple swap?
@larwortsomv7905
@larwortsomv7905 2 года назад
Excellent
Далее
Deducing this Patterns - Ben Deane - CppCon 2021
1:02:42
Лиса🦊 УЖЕ НА ВСЕХ ПЛОЩАДКАХ!
00:24
The Basics of Profiling - Mathieu Ropert - CppCon 2021
59:37
Branchless Programming in C++ - Fedor Pikus - CppCon 2021
1:03:57
Goodbye, TAM
12:01
Просмотров 50 тыс.
Лиса🦊 УЖЕ НА ВСЕХ ПЛОЩАДКАХ!
00:24