Hi All,Greetings my first post, hopefully helpful for someone else besides 
myself.I am facing difficulties trying to understand the wiki page 
Policies/Binary Compatibility Issues With C++ in the sectionAdding new data 
members to classes without d-pointer. I think the docu is wrong (please forgive 
and coreect me if i am wrong) the code sample following was taken from the docu 
and i have added some comment using triple slash (///):Code: Select all// BCI: 
Add a real d-pointer
Q_GLOBAL_STATIC(QHash<Foo *,FooPrivate>, d_func); ///FooPrivate is not declare 
as a pointer here.
static FooPrivate* d( const Foo* foo )
{
 // i think here it would failed since is expecting a pointer or?
    FooPrivate* ret = d_func()->value( foo, 0 );
    if ( ! ret ) {
        ret = new FooPrivate;///here is a pointer
        d_func()->insert( foo, ret ); 
    }
    return ret;
}
static void delete_d( const Foo* foo )
{
    FooPrivate* ret = d_func()->value( foo, 0 );
///delete is called without validating the pointer
    delete ret;
    d_func()->remove( foo );
}The question is about the pointers usage here.cafu

Re: Adding new data members to classes without d-pointerThu Jul 26, 2012 7:24 
am from bcooksley Given the nature of this problem, I would prefer to delegate 
to the people more versed in binary compatibility. Binary compatibility is very 
important to KDE.

Please send an email regarding this to kde-devel@kde.org.                       
                  
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to