Yeah, I've seem the pattern before (although I've never heard it called "d-pointer", but rather other names including "The PIMPL Idiom"). Still, as applied to the TabLib::Tag class its usage seems a little strange since it's abstract and not a single methods uses the indirection that makes the idiom work (in this case indirection through TagLib::Tag::d). I can see that if maintaining binary compatibility while exposing raw C++ classes is important the change I originally suggested wont work because it will change the sizes of all the classes which derive from TagLib::Tag.<br>
<br>Steve<br><br><div class="gmail_quote">On Tue, Dec 15, 2009 at 11:44 PM, Scott Wheeler <span dir="ltr"><<a href="mailto:wheeler@kde.org">wheeler@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
On Dec 15, 2009, at 9:20 AM, Stephen Hewitt wrote:<br>
<br>
> Can you elaborate on these ABI reasons or point me somewhere that<br>
> does? I didn't notice any assumptions about the layout/size of<br>
> TagLib::Tag made in the code other that via the header in question?<br>
> If there is a valid reason I'd suggest a comment was in order.<br>
<br>
<br>
</div>The problem is the size of the object in the shared library -- that<br>
can't change between releases or else it will break applications that<br>
use that interface when upgrading TagLib. If you need to add an<br>
attribute in a future release, you need to reserve a pointer to a<br>
private object for future use. Creating a "d-pointer" like that is<br>
standard practice in C++ libraries that attempt to maintain binary<br>
compatibility across releases:<br>
<br>
<a href="http://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B#Using_a_d-Pointer" target="_blank">http://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B#Using_a_d-Pointer</a><br>
<font color="#888888"><br>
-Scott<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
taglib-devel mailing list<br>
<a href="mailto:taglib-devel@kde.org">taglib-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/taglib-devel" target="_blank">https://mail.kde.org/mailman/listinfo/taglib-devel</a><br>
</div></div></blockquote></div><br>