ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::boxing::FIsNotNull Struct Reference

Description:

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 the static method ConstantTrue. This function is set as the specific implementation for all arithmetical types, as well as for type bool.

Note
The reason why this function is not declared as FIsNull, but instead is negated, is that if any function is called on a void box, a default value is returned. The default value of bool is false, which probably better fits - even if conceptually a void box is undefined and therefore neither nulled or not.

Definition at line 29 of file functiondecls.inl.

Public Type Index:

using Signature = bool (*) ( const Box& self )
 

Public Static Method Index:

static ALIB_DLL bool ConstantTrue (const Box &)
 

Type Definition Details:

◆ Signature

using alib::boxing::FIsNotNull::Signature = bool (*) ( const Box& self )

Signature of the invokable function.

Parameters
selfThe box that the function was invoked on.
Returns
Return false if a boxed value is nulled, true otherwise.

Definition at line 35 of file functiondecls.inl.

Method Details:

◆ ConstantTrue()

bool alib::boxing::FIsNotNull::ConstantTrue ( const Box & )
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.

Returns
Constant true.

Definition at line 175 of file box.cpp.

Here is the call graph for this function:

The documentation for this struct was generated from the following files: