Re:The PImpl idiom and the C++26 std:indirect type
by ghosty141 on Friday July 24, 2026 @06:38AM
(#49033599)
pimpl helps more since its trivially implementable in existing codebases while modules are a much bigger pain.
Re:The PImpl idiom and the C++26 std:indirect type
by cemdervis on Friday July 24, 2026 @07:02AM
(#49033800)
pimpl also helps to keep data structure layout stable, e.g. Qt's d-pointer convention
Re:The PImpl idiom and the C++26 std:indirect type
by knorker on Friday July 24, 2026 @07:06AM
(#49033837)
pimpl also makes it much easier to make changes without breaking ABI. E.g. shared libraries.
Re:The PImpl idiom and the C++26 std:indirect type
by pjmlp on Friday July 24, 2026 @10:06AM
(#49035882)
Even with modules, if you expose such types over the ABI, naturally the machine code memory layout will change, this is an issue regardless of the language.
I was pondering on why he was putting the defaulted methods in the cpp, any particular reasons?
I did realize that the indirect version is required to be in the cpp since the header won't know how to copy without knowing the definition of the impl class.