On Mon, Dec 29, 2014 at 8:22 PM, Derek Atkins <[email protected]> wrote: > Because it's a constant. >
Thanks! In following scenario, a QofInstance cannot be added into a QofCollection QofIdType type = "some type"; QofInstance inst = g_object_new (QOF_TYPE_INSTANCE, NULL); inst->e_type = type; QofCollection coll = qof_collection_new (type); qof_collection_add_entity (coll, inst); The last call will always fail, because coll's e_type has different address with the original variable type due to invocation of static_cast<QofIdType> > -derek > > Sent on my mobile. Please forgive any typos. > > ----- Reply message ----- > From: "Chenxiong Qi" <[email protected]> > To: "[email protected]" <[email protected]> > Subject: Question about QofIdType assertion in QofCollection > Date: Mon, Dec 29, 2014 3:35 AM > > Hi all, > > In qof_collection_add_entity and qof_collection_insert_entity, it expects, > > g_return_if_fail (col->e_type == ent->e_type); > > Is this the actual expectation by checking the equivalence of pointer > locations, why not the values? > > -- > Regards, > Chenxiong Qi > _______________________________________________ > gnucash-devel mailing list > [email protected] > https://lists.gnucash.org/mailman/listinfo/gnucash-devel -- Regards, Chenxiong Qi _______________________________________________ gnucash-devel mailing list [email protected] https://lists.gnucash.org/mailman/listinfo/gnucash-devel
