Skip to content

fix(examples): make snippets compile — algorithms, ranges, iterators, utilities, concepts #28

Closed

Description

@homer6

Part of #20. Drive tools/snippet_baseline/gcc.txt to empty for these folders: fix each failing block (make it self-contained, add a prelude name only if it's truly generic, or use body), or tag it nocompile / compile-fail="…" / needs=… when that's the honest answer. Delete fixed lines from the baseline. Don't change what a page teaches; if a snippet is wrong, fix it and say so in the PR.

Folders: docs/examples/algorithms, docs/examples/ranges, docs/examples/iterators, docs/examples/utilities, docs/examples/concepts

Acceptance: no baseline entries left for these folders; python3 tools/check_snippets.py <folders> --cxx g++-15 -q --baseline tools/snippet_baseline/gcc.txt exits 0.

Activity

  1. homer6 commented on Oct 31, 2026

    @homer6
    OwnerAuthor

    Delivered in #31.

    What changed

    • All 80 failing snippets in docs/examples/{algorithms,ranges,iterators,utilities,concepts} now compile; their 80 lines are deleted from tools/snippet_baseline/gcc.txt. No prelude changes.
    • Fixed snippets that were wrong, not just incomplete: a sort example that used v both as ints and as records with .score; set operations given a container where an output iterator is required; bare iterator_traits type names (ill-formed); discarded front_inserter/inserter expressions; from_chars without <charconv>; function/template definitions inside statement blocks. Bare name lists became static_asserts or one usage line each.

    Why

    Still open

    • Clang 22 + libc++: 5 blocks fail because libc++ lacks parallel execution policies, views::enumerate/chunk/slide/stride, and move_only_function.
  2. homer6 commented on Oct 31, 2026

    @homer6
    OwnerAuthor

    Merged in #31 (3328c7c).

    What changed

    Why

    • Merged at the owner's request after review. Checks re-run after the rebase: guidelines 0 failed, examples baseline run exits 0, links OK.

    Still open

    • Nothing for this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions