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

call from class fcf::SpecificatorInfo

Property: call

Type: void*

Class: fcf::SpecificatorInfo

Package: fcfBasis

File: bits/PartSpecificator/SpecificatorInfo.hpp

Available from version: 1.0.1

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

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 FCF_BASIS_IMPLEMENTATION #include <fcfBasis/basis.hpp> int main() { const fcf::TypeInfo* ti = fcf::Type<int>().typeInfo(); unsigned int lessSpecificatorTypeId = fcf::Type<fcf::LessSpecificator>().index(); const fcf::SpecificatorInfo& si = ti->specificators.find(lessSpecificatorTypeId)->second; fcf::LessSpecificator::CallType call = (fcf::LessSpecificator::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