This built-in box function constitutes the concept of "nullable types". Nullable types are pointer types, array types and custom types that are nullable. Arithmetical types are never nulled, even if they contain value 0
or 0.0
.
A default implementation is given, which returns false
(not nulled!) if the first word in the placeholder is not 0
. Hence this works for array and pointer types.
A constant function return true
is given with static method ConstantTrue. This function is set as the specific implementation for all arithmetical types, as well as for type bool
.
bool
is false
, which probably better fits - even if conceptually a void box is undefined and therefore neither nulled or not. Definition at line 34 of file functions.inl.
Public Type Index: | |
using | Signature = bool (*) ( const Box& self ) |
Public Static Method Index: | |
static ALIB_API bool | ConstantTrue (const Box &) |
Signature of the invokable function.
self | The box that the function was invoked on. |
false
if a boxed value is nulled, true
otherwise. Definition at line 42 of file functions.inl.
|
static |
This implementation of the function signature returns constant true
. It may be registered with custom types that do not provide the concept of being nulled. Bootstrapping function boxing::Bootstrap registers this implementation with type bool
and all integral, floating point and character types.
true
. Definition at line 708 of file boxing.cpp.