Unused PIMPL pointer in TagLib::Tag

Scott Wheeler wheeler at kde.org
Tue Dec 15 13:44:34 CET 2009


On Dec 15, 2009, at 9:20 AM, Stephen Hewitt wrote:

> Can you elaborate on these ABI reasons or point me somewhere that  
> does? I didn't notice any assumptions about the layout/size of  
> TagLib::Tag made in the code other that via the header in question?  
> If there is a valid reason I'd suggest a comment was in order.


The problem is the size of the object in the shared library -- that  
can't change between releases or else it will break applications that  
use that interface when upgrading TagLib.  If you need to add an  
attribute in a future release, you need to reserve a pointer to a  
private object for future use.  Creating a "d-pointer" like that is  
standard practice in C++ libraries that attempt to maintain binary  
compatibility across releases:

http://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B#Using_a_d-Pointer

-Scott


More information about the taglib-devel mailing list