Nullary Functions


Nullary functions are defined as an object (c++ class/struct) that is sometimes otherwise known as callable without any argument passing.

Compiling & Linking

Include the following at the top of any translation unit for which you are running compile time checks on your blueprint classes.

Since it only uses macros and templatised objects, no linking is required for just this feature.

Concept Definition

Creating a class can be done in any namespace, it just has to satisfy the conditions outlined below:

  • operator()() : a method for executing the nullary function object.
  • typedef result_type : a typedef to the return type of the operator.


Use with the compile time concept check whenever you wish to check for a nullary function object input. For example, the Thread class (ecl_threads) utilises this in a similar way to that outlined below:

template<typename F>
Thread(F function) {
Compile time meta-programming concepts.
Defines validating functionality for the nullary function concept.
Definition: nullary_function.hpp:41

Author(s): Daniel Stonier
autogenerated on Sun Aug 2 2020 03:12:08