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

backConverters from class fcf::TypeInfo

Property: backConverters

Type: fcf::TypeInfo::ConvertersType

Class: fcf::TypeInfo

Package: fcfBasis

File: bits/PartType/TypeInfoDefinition.hpp

Available from version: 1.0.1

Map of conversion functions for converting TO this type

Example:

#include <iostream> #define FCF_BASIS_IMPLEMENTATION #include <fcfBasis/basis.hpp> int main() { const fcf::TypeInfo* ti = fcf::Type<int>().typeInfo(); std::string strValue = "999.9"; int intValue; fcf::ConvertFunction convertFunction = ti->backConverters.find(fcf::Type< std::string >().index())->second; convertFunction(&intValue, &strValue, 0); std::cout << "Converted int value: " << intValue << std::endl; return 0; }

Output:

Converted int value: 999