xo-facet: + _has_null_vptr() helper.

Will be load-bearing for gc
This commit is contained in:
Roland Conybeare 2026-03-24 17:48:44 -04:00
commit 483ee5c2a8

View file

@ -58,6 +58,11 @@ public:
///@{
{% endif %}
// const methods
/** An uninitialized {{abstract_facet}} instance will have zero vtable pointer (per {linux,osx} abi).
* Use case for this is narrow. We go to some lengths to avoid null vtable pointers. For example
* obj<AFacet> will have non-null vtable (via IFacet_Any) with all methods terminating.
**/
bool _has_null_vptr() const noexcept { return *reinterpret_cast<const void * const *>(this) == nullptr; }
/** RTTI: unique id# for actual runtime data representation **/
virtual typeseq _typeseq() const noexcept = 0;
/** destroy instance @p d; calls c++ dtor only for actual runtime type; does not recover memory **/