Writing
27 posts. Most of them are from 2020, when I went through modern C++ one feature at a time. Newer ones are about Dynamics 365 and tooling.
2020
- Inline AsmNotes on writing inline assembly in C/C++ with GCC and Clang: AT&T (GAS) syntax vs Intel syntax, addressing modes and extended asm.
- SIMDA short look at SIMD on x86: MMX, SSE and AVX registers, checking CPU support with cpuid, and dividing vectors with inline asm and intrinsics.
- [[deprecated]][[deprecated]] is a C++14 attribute that marks a function, class or variable as something that will be removed, so the compiler warns anyone who uses it.
- To be Modern or NotA checklist of modern C++ habits since C++11, linking to my notes on constructors, smart pointers, templates, lambdas and concurrency.
- Boris Johnson and CoronavirusLiving through the first weeks of Covid-19 in Great Britain, and the other virus spreading through our phones.
- LambdaNotes on C++ lambdas: basic syntax, generic lambdas with auto, mutable, and capturing by copy or by reference, with C++20 updates.
- Mutex and AtomicsProtecting a shared sum in C++ with std::mutex, a lock held over the whole loop, and std::atomic, and what each one costs.
- Threads in C++Notes on std::thread in C++: join and detach, passing arguments with std::ref and std::cref, and protecting shared data with a mutex.
- Variadic TemplateVariadic templates in C++: parameter packs, recursion with an empty base case, sizeof... and C++17 fold expressions.
- Non-type Template in ArrayDeducing the size of a C array with a non-type template parameter, so you don't have to pass the size as an argument.
- Perfect Forwarding with TemplateUsing a constructor template with a forwarding reference and std::forward, so the right copy or move constructor is called.
- TemplateA short code review of C++ function templates: explicit instantiation, explicit specialization and non-type template parameters.
- Destructors Are noexcept by DefaultSince C++11 destructors are implicitly noexcept, so an exception that leaves a destructor calls std::terminate.
- Diamond InheritanceUsing virtual inheritance in C++ so a class that appears twice in a diamond hierarchy has only one shared base subobject.
- Implementing Constructors on Inheritance with using Keyword in C++Since C++11, using Base::Base; lets a child class inherit the constructors of its parent instead of writing them again.
- Virtual Methods and Abstract Classes in C++Virtual methods, pure virtual methods and abstract classes in C++, plus override, final and why a base class needs a virtual destructor.
- Constexpr in C++Short notes on constexpr in C++: how it differs from const, what a constexpr function can do, and what changed in C++14, C++20 and C++23.
- Enums in C++A short note on C++11 enum class: scoped names, a fixed underlying type, no implicit int conversion, plus using enum and std::to_underlying.
- initializer_list in C++When you initialize an auto variable with a braced list, the C++ compiler deduces its type as std::initializer_list.
- Smart pointersMy notes on C++ smart pointers: unique_ptr, shared_ptr and weak_ptr, how to pass them to functions and how weak_ptr breaks circular references.
- Cast in C++My short notes on the four C++ cast operators (static_cast, reinterpret_cast, const_cast, dynamic_cast), C-style casts and std::bit_cast.
- Copy and Move ConstructorsHow copy and move constructors work in C++, with an example class that owns a pointer, plus notes on std::move, noexcept and copy elision.
- Delete, Default and Delegating ConstructorsHow = default, = delete and delegating constructors (C++11) help you control which constructors the compiler generates for a class.
- Why non-static data member initialization is importantC++11 default member initializers let you initialize class members where they are declared, so every constructor gets the same defaults.
- Hello world!Reopening my personal blog after a long break, now in English, with the obligatory Hello World.