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.
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.
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.
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.
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.
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.
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.
November 8, 2026
C++ Basics: Find a Run of Consecutive Failures
Use search_n to locate consecutive repeated values rather than counting separated occurrences.
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.
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.
November 8, 2026