Skip to content

Refactor pimpl pointers in XMLSchemaComplexTypeGenerator and XMLValidator to unique_ptr#661

Open
lyskov-ai wants to merge 1 commit intoRosettaCommons:mainfrom
lyskov-ai:refactor/pimpl-unique-ptr-xml-schema
Open

Refactor pimpl pointers in XMLSchemaComplexTypeGenerator and XMLValidator to unique_ptr#661
lyskov-ai wants to merge 1 commit intoRosettaCommons:mainfrom
lyskov-ai:refactor/pimpl-unique-ptr-xml-schema

Conversation

@lyskov-ai
Copy link
Copy Markdown
Contributor

Summary

  • Replace raw class Impl* pimpl members with std::unique_ptr<class Impl> in XMLSchemaComplexTypeGenerator and XMLValidator
  • Destructors changed from { delete pimpl_; } to = default, letting the compiler generate correct cleanup
  • Added #include <memory> to both headers

Motivation

Both classes already correctly suppressed copy/move with = delete, so there was no double-free risk. This refactor makes ownership explicit in the type system and eliminates manual delete calls, following the Rule of Zero pattern for pimpl idiom.

Testing

Full debug build succeeds. No behavior change — pure ownership semantics refactor.

…ator to unique_ptr

Replace raw owning `class Impl*` members with `std::unique_ptr<class Impl>`,
allowing destructors to be defaulted and making ownership explicit in the type system.
@lyskov lyskov requested a review from roccomoretti April 29, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants