%F and %R in C++ chrono: fixed UTC offsets vs named time zones
`%F` prints the date and `%R` prints hours and minutes in 24-hour format. They format the value you pass; time-zone rules belong to the conversion step.
CKTIS / Knowledge base
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
`%F` prints the date and `%R` prints hours and minutes in 24-hour format. They format the value you pass; time-zone rules belong to the conversion step.
`extern "C"` specifies language linkage for interoperability between C and C++. It does not switch the compiler to C or guarantee binary compatibility on its own.
Separate storage management from object lifetime, choose the alignment-aware overloads, and forward the same alignment to the matching global functions.
Returning by value does not necessarily copy an object. Distinguish optional NRVO for a named local from guaranteed direct construction from a same-type prvalue.
Set `std::cout` to fixed-point notation with two digits after the decimal separator. Learn why the `floatfield` mask matters and how to restore the previous format.
A standalone ellipsis in `test(...)` provides a fallback overload when a typed probe cannot match. It is not a template parameter pack or pack expansion.
Choose a layout around how your program uses its data: compare whole records with separate columns, then measure the effect on a representative workload.
`= default` asks the compiler to supply the standard definition of an eligible function. Ownership, PImpl, and virtual destructors show where this matters.
Declare a public virtual base-class destructor so a derived object can be deleted through a base pointer without writing a destructor body for the base class.
In C++23, `= default` asks the compiler for the standard definition of a special member function. Definition placement matters in Pimpl; C++23 implementation support may vary.
`Product() = default;` explicitly declares a default constructor and lets the compiler implement it. The `default:` label in a `switch` marks where execution starts when no `case` matches.
Declare a pointer to a non-static `int` data member and a pointer to a `const` member function. See how the declared type selects an overload and how to use either pointer with an object.
`= delete` forbids use of a function at compile time. A coroutine frame owner can use it to forbid copying while still transferring ownership by moving and releasing the frame in its destructor.
Reject a specific overload or prevent copying at compile time while keeping a class movable and handling destruction of its hidden implementation correctly.
`= delete` makes a specific function unusable at compile time. Use it to reject an unwanted overload or to prevent an owning pool from being copied or moved.
A destructor marks the end of an object's lifetime and cleans up its resources. Learn how an owner destroys a coroutine frame and why a PImpl destructor is defined out of line.
`~T() = default;` asks the compiler to define a destructor by the language rules. `default:` marks where a `switch` starts executing when no `case` matches.
The basic guarantee permits partial changes that leave valid state. The strong guarantee leaves no observable change on exception. The no-throw guarantee prevents exceptions from reaching the caller.
A compile-time flag selects a program variant when you build it. A runtime flag changes the behavior of an already-built program.
Append `f` or `F` to make a floating-point literal a `float` rather than the default `double`. This affects type deduction and overload resolution.
With `F` deduced, `F&&` can bind to either an lvalue or an rvalue. A direct call `f()` treats the callable as an lvalue; `std::forward<F>(f)` passes it on as an lvalue or rvalue according to the argument.
Search an ordered associative container with a different type from its key, without constructing a temporary key. Learn why `std::less<>` enables the lookup overloads and why mixed comparisons must agree with the key order.
In C++23, `return a;` can move from a by-value parameter. This is not NRVO: the parameter is a separate object from the result.
Define an inline variable with external linkage in a shared header to give multiple translation units the same object. Compare it with an ordinary namespace-scope `const` that gives each translation unit its own object.