Repository navigation
fix: registry::with<P> appended a policy the registry already had - #150
Merged
Merged
Conversation
with_aux decided whether a policy's category was already present by comparing the policy list before and after replacing it. When the new policy is the one already there, the replacement leaves the list unchanged, so it was taken for "absent" and appended a second copy: registry<foo1>::with<foo1> was registry<foo1, foo1>, and default_registry::with<policies::fast_perfect_hash> failed the "two or more stateful policies ... share the same nested `state` type" static_assert. Ask whether the category is present with mp_any_of instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
An automated preview of the documentation is available at https://150.openmethod.prtest3.cppalliance.org/libs/openmethod/doc/html/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-11-28 16:55:12 UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #150 +/- ##
========================================
Coverage 92.56% 92.57%
========================================
Files 29 29
Lines 2314 2316 +2
Branches 699 700 +1
========================================
+ Hits 2142 2144 +2
Misses 111 111
Partials 61 61
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
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.
(Written by Claude Code, on behalf of @jll63.)
registry::with<P>is meant to replace the registry's policy inP's category, or appendPif the category is empty.with_auxtold the two apart by comparing the policy list before and after the replacement. WhenPis the very policy already in its category, the list does not change, so it was taken for "absent" andPwas appended a second time:The fix asks whether the category is present directly, with
mp_any_of.Tests
Three
static_asserts intest/test_policies.cpp, all of which failed before the fix:with<>of the policy already present, alone, together with a real replacement, and ondefault_registry.toolset=gcc): 258 passed, 0 failed./std:c++20 /W4 /WX:test_policies.cppcompiles.🤖 Generated with Claude Code