ALib C++ Library
Library Version: 2312 R0
Documentation generated by doxygen
Public Types | Public Static Methods | List of all members
FIsNotNull Struct Reference

Class 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 Types

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

Public Static Methods

static ALIB_API bool ConstantTrue (const Box &)
 

Member Typedef Documentation

◆ 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.

Member Function Documentation

◆ ConstantTrue()

bool ConstantTrue ( const Box )
static

This implementation of function FIsNotNull 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: