diff --git a/include/xo/numeric/detail/ANumeric.hpp b/include/xo/numeric/detail/ANumeric.hpp index bda27456..7c8e0c99 100644 --- a/include/xo/numeric/detail/ANumeric.hpp +++ b/include/xo/numeric/detail/ANumeric.hpp @@ -42,6 +42,11 @@ public: /** @defgroup scm-numeric-methods **/ ///@{ // const methods + /** An uninitialized ANumeric 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 will have non-null vtable (via IFacet_Any) with all methods terminating. + **/ + bool _has_null_vptr() const noexcept { return *reinterpret_cast(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 **/ diff --git a/include/xo/numeric/detail/RNumeric.hpp b/include/xo/numeric/detail/RNumeric.hpp index 86cac666..35a704ec 100644 --- a/include/xo/numeric/detail/RNumeric.hpp +++ b/include/xo/numeric/detail/RNumeric.hpp @@ -46,6 +46,7 @@ public: ///@{ // explicit injected content + static obj multiply(obj lhs, obj rhs); // builtin methods typeseq _typeseq() const noexcept { return O::iface()->_typeseq(); }