Entries by Rainer Grimm

C++20: Creating Calendar Dates

In this post, I will dive deeper into calendar dates and create them. If this post is too overwhelming for you, read my previous ones: C++20 supports constants and literals to make using calendar-date types more convenient. Constants and Literals for Calendar Types Let me start with the constants for std::chrono::weekday, and std::chrono::month. std::chrono::Monday std::chrono::Thuesday […]

My ALS Journey: 8/n with Easter Present

I’m happy to announce the second money-raising campaign for ALS research. This time, I’m proud to say that Andreas Fertig, Bartłomiej Filipek, Jason Turner, and Dmitry Vostokov will participate. My ALS Journey so far C++ Classes and Mentoring In the last three weeks, I have given three online classes. Additionally, each Friday, there is my […]

C++20: Time of Day

This new data type std::chrono::hh_mm_ss in C++20 stands for the time of day. Time of Day std::chrono::hh_mm_ss is the duration since midnight split into hours, minutes, seconds, and fractional seconds. This type is typically used as a formatting tool. First, the following table gives you a concise overview of std::chrono::hh_mm_ss instance tOfDay. Depending on the […]

C++20: Basic Chrono Terminology with Time Duration and Time Point

Today, I continue my journey through the basic types with time durations and time points. Time Durations C++14 introduced helper types such as std::chrono::seconds for time durations and corresponding time literals such as 5s. C++20 added new helper types. The following table shows all for completeness. Often the time duration std::chrono::days and the calendar date […]

C++20: Basic Chrono Terminology

To get the most out of the chrono extension in C++20, a basic understanding of the chrono terminology is essential. Basic Chrono Terminology Essentially, the time-zone functionality (C++20) is based on the calendar functionality (C++20) and the calendar functionality (C++20), which are based on the chrono functionality (C++11). Consequently, this basic chrono terminology starts with […]

My ALS Journey: 7/n

Today, I write about my journey in chronological order. Visit from Jens On Wednesday, the 14th, my good friend Jens Weller (Meeting C++) visited me. Honestly, I was in bad condition. Due to lack of air, I could hardly speak. Additionally, I was exhausted and tired, almost delirious. Two days later, I went to the […]

More Details to Formatting User-Defined Types in C++20

Implementing a formatter for a user-defined type having more than one value in C++20 is challenging. This post is the 5th post in my miniseries about formatting in C++20. Read the previous ones here: A Formatter for More Values Point is a class with three members. // formatPoint.cpp #include <format> #include <iostream> #include <string> struct […]

My ALS Journey: 6/n

Here is the next step in my journey. This one is optimistic. CppCast, C++Online, and AMA In February, I have a few public events: The Bright Side of Life A horrible diagnosis, such as ALS, changes you fundamentally. This also happened to me. Before the diagnosis, I have been a workaholic. I usually began to […]

Formatting User-Defined Types in C++20

Additionally, to the basic types and std::string, you can also format user-defined types in C++20. So far, I have formatted basic types and std::string. Here are my previous posts: std::formatter enables it to format user-defined types. You have to specialize the class std::formatter for the user-defined type. In particular, you must implement the member functions […]