Can someone explain the following code snippet for me?
// Bind base object so we can compute offsets
// currently only implemented for indexes.
template<class DataObj> void BindAsBase(DataObj &rowbuf)
{
// Attempting to assign working_type first guarantees exception safety.
working_type = DTL_TYPEID_NAME (rowbuf);
working_addr = reinterpret_cast<BYTE*>(&rowbuf);
working_size = sizeof(rowbuf);
}
My problem is what is the result of sizeof(rowbuf)? Is it the length of DataObj or either the length of Byte*? why?
Another question: why there is a need to calculate offset of pointer? What is the usual use of it?
What is sizeof(working_addr) equal to?