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

converters from class fcf::TypeInfo

Property: converters

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 FROM this type

Example:

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

Output:

Converted string value: '5'