Skip to content

Add missing <algorithm> include to buffer_cache.h - #3053

Merged
awni merged 1 commit into
ml-explore:mainfrom
Anri-Lombard:fix/buffer-cache-missing-include
Jan 23, 2026
Merged

awni merged 1 commit into
ml-explore:mainfrom
Anri-Lombard:fix/buffer-cache-missing-include

Conversation

@Anri-Lombard

Copy link
Copy Markdown
Contributor

Proposed changes

Fixes #3051.

buffer_cache.h uses std::find_if but doesn't include <algorithm>. This works with Clang (which transitively includes it through <functional> or <map>), but fails with GCC 15+.

@awni would something like https://github.com/include-what-you-use/include-what-you-use be useful to catch these? Or is it too noisy for this codebase?

Checklist

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

Fixes compilation with GCC 15+ which doesn't transitively include
<algorithm> through <functional> or <map>. Fixes ml-explore#3051.
@Anri-Lombard
Anri-Lombard force-pushed the fix/buffer-cache-missing-include branch from d90fe18 to 286d2a7 Compare January 23, 2026 17:21

@angeloskath angeloskath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

You can see the discussion regarding IWYU at #3000 ...

@awni
awni merged commit dc81c15 into ml-explore:main Jan 23, 2026
16 checks passed
@BrewTestBot BrewTestBot mentioned this pull request Jan 27, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] compilation error with buffer_cache.h (indirectly through ollama pulling ml-explore/mlx-c)

3 participants