Add const OffsetTo<> dereference

Unused, but now that we have CrapPool, implement it.
This commit is contained in:
Behdad Esfahbod 2018-05-31 17:58:40 -07:00
parent 2baa357ac7
commit dcd1b07eea
1 changed files with 6 additions and 0 deletions

View File

@ -779,6 +779,12 @@ struct OffsetTo : Offset<OffsetType>
{
unsigned int offset = *this;
if (unlikely (!offset)) return Null(Type);
return StructAtOffset<const Type> (base, offset);
}
inline Type& operator () (void *base) const
{
unsigned int offset = *this;
if (unlikely (!offset)) return Crap(Type);
return StructAtOffset<Type> (base, offset);
}