Skip to content

fix(post): the hookless clone mixin throws, and examples links move to the new SHA - #264

Merged
filipsajdak merged 1 commit into
mainfrom
fix/clone-series-loud-mixin
Nov 9, 2026
Merged

filipsajdak merged 1 commit into
mainfrom
fix/clone-series-loud-mixin

Conversation

@filipsajdak

Copy link
Copy Markdown
Contributor

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

…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>
Copilot AI balanced review requested due to automatic review settings November 9, 2026 22:23
@filipsajdak
filipsajdak merged commit 72a49dd into main Nov 9, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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_unavailable instead 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"};
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