Repository navigation
fix(post): the hookless clone mixin throws, and examples links move to the new SHA - #264
Merged
Merged
Conversation
…o the new SHA Episode 4 and its caption now say a class outside the searched namespace makes clone() throw clone_unavailable instead of returning an empty pointer. Episodes 1 to 4 pin their examples directories to the merge that contains the change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The code listing omits the dynamic-type diagnostic promised by the documented output, and the six-bullet summary exceeds the style guide’s five-bullet limit.
2 open issues
What changed in this PR
Updates the clone-series posts and Episode 4's LinkedIn caption to reflect the hookless mixin's exception behavior and revised examples.
Changes:
- Documents
clone_unavailableinstead of an empty pointer when no searched class matches the dynamic type. - Pins all four episodes' example links to commit
203fcee. - Replaces Episode 4's two affected Compiler Explorer embeds.
| File | Description |
|---|---|
src/content/posts/2026-12-21-std-polymorphic-instead-of-clone.mdx |
Updates failure behavior, sample output, embeds, and source link. |
src/content/posts/2026-12-19-catch-a-forgotten-clone-override.mdx |
Pins Episode 3's examples to the new commit. |
src/content/posts/2026-12-17-deducing-this-clone-without-covariance.mdx |
Pins Episode 2's examples to the new commit. |
src/content/posts/2026-12-15-clone-helper-ub-forgotten-override.mdx |
Pins Episode 1's examples to the new commit. |
social/linkedin/std-polymorphic-instead-of-clone/caption.md |
Notes that cloning an unsearched class throws. |
Review effort: Balanced
Comment on lines
+25
to
+26
| - The mixin `AutoCloneable` has no template parameters and no hooks. Its `clone()` deduces the caller's type and uses reflection to copy with the class that matches the dynamic type. Classes write nothing, repeat no type name, and need neither a copy hook nor a move hook. | ||
| - A class outside the searched namespace makes `clone()` throw. The failure is loud, not an empty pointer. |
| } | ||
| } | ||
| } | ||
| if (!out) throw clone_unavailable{"no searched class has the dynamic type"}; |
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.

Episode 4 and its captions now say a class outside the searched namespace makes the hookless clone() throw clone_unavailable (a std::logic_error naming the dynamic type) instead of returning an empty pointer. Episodes 1 to 4 pin their examples directories to wrocpp/cpp26-reflection-examples#79 (203fcee), which contains the change; the two Ep4 Compiler Explorer ids are the re-minted ones.
Verification: prose-lint clean, production build exits 0. The posts are dated 15 to 21 December and answer 404 until then.
Generated with Claude Code