ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
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 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 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 &)
 

Type Definition Details:

◆ Signature

using 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 42 of file functions.inl.

Method Details:

◆ ConstantTrue()

bool 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 708 of file boxing.cpp.


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