Repository navigation
Common: add MoveOnlyFunction for move-only callbacks - #1810
Merged
Mysticial merged 1 commit intoNov 1, 2026
Merged
Conversation
dayfine
marked this pull request as ready for review
November 1, 2026 05:04
std::function is copyable: copying one silently forks a stateful lambda's state, and it can't hold move-only captures. std::move_only_function (C++23) fixes both, but Apple Clang's libc++ doesn't implement it yet. MoveOnlyFunction is an alias of std::move_only_function where the library provides it, and a small fallback elsewhere, with copying deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
force-pushed
the
upstream/move-only-function
branch
from
November 1, 2026 05:08
95e3e64 to
bda38f7
Compare
dayfine
added a commit
to dayfine/Arduino-Source
that referenced
this pull request
Nov 1, 2026
…mation#1810; base refreshed to b3673f2 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
to dayfine/Arduino-Source
that referenced
this pull request
Nov 1, 2026
Upstream merged MoveOnlyFunction as PokemonAutomation#1810, so this branch's copy is redundant: MoveOnlyFunction_Tests.cpp takes upstream's version, the header and test list were already identical. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
to dayfine/Arduino-Source
that referenced
this pull request
Nov 2, 2026
Upstream merged MoveOnlyFunction as PokemonAutomation#1810. Conflicts in MoveOnlyFunction_Tests.cpp, ComputerPrograms_UnitTestRunner.cpp and SourceFiles.cmake take main's (PokemonAutomation#1810's) versions; this branch's migration of the thread pool and its callers is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Base:
main; independent, single commit.Adds
MoveOnlyFunctionfor callbacks with one owner and move-only captures. Usesstd::move_only_functionwhere available, with a small fallback for Apple libc++. Existing callbacks are unchanged.Four unit tests cover move-only captures, state across moves, empty/null callables, and reassignment. Build/tests passed on Mac, Windows Clang, and Ubuntu at
95e3e6479.The fork's code-health check flags the fallback's internal type-erasure interface as a single-method interface; that finding remains unresolved.
Prepared with Claude Code and Codex. Fork review: dayfine#72.