Skip to content

Posts

C++ Basics: Sort References Without Reordering the Original Records

Build a sortable list of reference_wrapper objects to view records in another order without copying them.

Read more →

November 8, 2026

C++ Basics: Select Read-Only Access to a Mutable Object

Use as_const to pass a mutable object through a const reference without copying it.

Read more →

November 8, 2026

C++ Basics: Remove Forward-List Nodes Without Skipping Matches

Track the preceding node when removing matching elements from a singly linked forward_list.

Read more →

November 8, 2026

C++ Basics: Preserve a Character Array and Its Terminator

Use to_array to copy a built-in character array into std::array while retaining its full extent.

Read more →

November 8, 2026

C++ Basics: Move a List Task Without Invalidating Its Iterator

Move a task between lists with splice while keeping an iterator to the same element.

Read more →

November 8, 2026

C++ Basics: Merge Two Sorted Halves Inside One Vector

Use inplace_merge when two adjacent parts of one buffer are already sorted by the same ordering.

Read more →

November 8, 2026

C++ Basics: Find the Largest Power of Two Within a Budget

Use bit_floor to choose a power-of-two capacity that does not exceed an unsigned budget.

Read more →

November 8, 2026

C++ Basics: Find a Run of Consecutive Failures

Use search_n to locate consecutive repeated values rather than counting separated occurrences.

Read more →

November 8, 2026

C++ Basics: Fill an Existing Buffer with Consecutive Values

Use iota to populate an existing integer range with a sequence starting at a chosen value.

Read more →

November 8, 2026

C++ Basics: Expand a Tuple into Function Arguments

Use apply to invoke a callable with the elements of a tuple as separate arguments.

Read more →

November 8, 2026