Skip to content

fix(examples): make snippets compile — containers, strings, text-processing #27

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/containers, docs/examples/strings, docs/examples/text-processing

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 #35.

    What changed

    • All 82 failing blocks in docs/examples/{containers,strings,text-processing} now compile (wrapped in main() or made body blocks with their declarations); their 82 lines are deleted from the baseline. No prelude changes.
    • Wrong snippets fixed: forward_list.md merge() had no argument and ran after reverse() (input unsorted); list.md merge() had no argument; localization.md promised 1,234,567.89 but printed 1.23457e+06 — now uses std::fixed and setprecision(2).

    Why

    Still open

    • needs=hive (5) and needs=inplace_vector (2) are uncompiled — no local compiler ships those headers. The mdspan blocks run on GCC 16.2 and Clang 22; only GCC 15 lacks the header.
  2. homer6 commented on Oct 31, 2026

    @homer6
    OwnerAuthor

    Merged in #35 (0a952c0).

    What changed

    • Nothing since the PR was opened. Rebased onto main before merging: No conflicts.

    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