Skip to content

Support member pointers in try_consume - #63

Merged
rigtorp merged 1 commit into
masterfrom
v2/02d-invoke
Nov 18, 2026
Merged

rigtorp merged 1 commit into
masterfrom
v2/02d-invoke

Conversation

@rigtorp

@rigtorp rigtorp commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Summary

- consumer(std::move(item))
+ std::invoke(std::forward<Consumer>(consumer), std::move(item))

Accept pointers to member functions and member data in try_consume.
Use std::is_nothrow_invocable_v<Consumer &&, T &&> to enforce the
existing non-throwing callback contract.

Evidence

  • Before Passing a member pointer failed to compile because the callback
    used direct function-call syntax.
  • After The queue test covers a non-throwing rvalue-qualified member
    function and a pointer to member data. Clang Release, ASan/UBSan,
    GCC 14 MC/DC, and GenMC passed locally.

Merge Danger

Door Two-way. A revert restores the previous callable constraint.

Blast radius try_consume callers. Member pointers become accepted
and callable overload resolution uses the supplied value category.

@rigtorp
rigtorp merged commit e37cb06 into master Nov 18, 2026
8 checks passed
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.

1 participant