Skip to content

fix: make indexed_range::accessor move constructible - #444

Merged
HDembinski merged 2 commits into
boostorg:developfrom
henryiii:fix-accessor-copy
Oct 12, 2026
Merged

HDembinski merged 2 commits into
boostorg:developfrom
henryiii:fix-accessor-copy

Conversation

@henryiii

@henryiii henryiii commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

The current macOS libc++ is broken. Claude wanted to fix it by making the private copy constructor public, I added a public move constructor instead, since that will keep the original intent to make copying a named accessor an error while also restoring std::generate support which now needs auto x = *it to work. Let me know if you'd like anything different.

🤖 AI text below 🤖

libc++ 21 (Apple clang 21) implements std::generate with a lambda that takes decltype(*first) by value, after passing it through an identity projection. For a proxy reference type this needs an accessible move constructor. indexed_range::accessor only had a private copy constructor, so indexed_test failed to compile on develop.

This adds a public move constructor to the accessor. The copy constructor stays private, so a named accessor still cannot be copied. The doc comment and changelog are updated.

libc++ 21 implements std::generate with a lambda that takes the
dereferenced iterator by value through an identity projection. This
needs an accessible move constructor on the accessor proxy, so
indexed_test failed to compile with Apple clang 21. The copy
constructor stays private.

Assisted-by: ClaudeCode:claude-fable-5-1
Comment thread doc/changelog.qbk Outdated
@HDembinski
HDembinski merged commit f9017f9 into boostorg:develop Oct 12, 2026
9 checks passed
@HDembinski

HDembinski commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

lgtm, thank you.

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.

2 participants