FCF 2.0 development in progress...
> > > > > >
[News] [C++ Libraries API] [C++ Downloads] [Donate to the project] [Contacts]

call from class fcf::SpecifierInfo

Property: call

Type: void*

Class: fcf::SpecifierInfo

Package: fcfBasis

File: bits/PartSpecifier/SpecifierInfo.hpp

Available from version: 1.0.1

A pointer to a specialized function that performs the action of the specifier.

Used for direct, high-performance execution of part-specific logic.

This field may be zero if the function specifier signature cannot be represented in a generic way (if it returns different data types depending on the type being processed).

Example:

#include <iostream> // Define an implementation macro to include the implementation section in header files #define FCF_BASIS_IMPLEMENTATION #include <fcfBasis/basis.hpp> int main() { const fcf::TypeInfo* ti = fcf::Type<int>().typeInfo(); unsigned int lessSpecifierTypeId = fcf::Type<fcf::LessSpecifier>().index(); const fcf::SpecifierInfo& si = ti->specifiers.find(lessSpecifierTypeId)->second; fcf::LessSpecifier::CallType call = (fcf::LessSpecifier::CallType)si.call; int left = 1; int right = 2; bool lessValue = call(&left, &right); std::cout << "1 < 2: " << lessValue << std::endl; return 0; }

Output:

1 < 2: 1