| Random Link ¯\_(ツ)_/¯ | ||
| Jun 4, 2022 | » | Unions in C++
2 min; updated Jun 4, 2022
A union is a |
| Jun 4, 2022 | » | Enumerations in C++
7 min; updated Jun 4, 2022
Unscoped (or Plain or C-Style) EnumerationsPlain (or C-style) enums are entered in the same scope as the name of their enum, and implicitly convert to their integer value, e.g. The name can be omitted if it’s not going to be used, e.g. Unnamed enums are common in code written before alternative ways of specifying integer constants, e.g. ... |
| Jun 4, 2022 | » | Structures in C++
1 min; updated Jun 4, 2022
A struct helps us organize the elements that a type needs into a data structure, e.g. However, notice that a user of There is no fundamental difference between a |
| Jun 4, 2022 | » | User-Defined Types
(6 items)
Classes in C++; Structures in C++; Enumerations in C++; Unions in C++; Dictionary-Based Implementation of Classes and Objects (Python); Inheritance; |
| May 31, 2022 | » | Resource Management in C++
4 min; updated May 31, 2022
Resource HandlesRAII is also covered in Classes in C++ > Motivation for the Destructor Mechanism The constructor/destructor pattern enables objects defined in a scope to
release the resources during exit from the scope, even when exceptions
are thrown. All standard-library containers, e.g.
|
| May 31, 2022 | » | Resource Management
(3 items)
AsyncIO in Python; Thread-Based Parallelism in Python; Resource Management in C++; |
| May 30, 2022 | » | Templates in C++
4 min; updated May 30, 2022
A template is a class or a function that we can parameterize with a set of types or values. Parameterized TypesThe vector-of-doubles can be generalized to a vector-of-anything type by making it a template: |
| May 12, 2022 | » | Classes in C++
15 min; updated May 12, 2022
A class is a user-defined type provided to represent a concept in the code of a program. Essentially, all language facilities beyond the fundamental types, operators, and statements exist to help define better class or to use them more conveniently. Sometimes I have problems defining the concept that is going to be
encapsulated as a class. Other times, the naming is hard, and I result
to common patterns like |
quotes Doug McIlroy:
What is the context of this quote?