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

index from class fcf::TypeInfo

Property: index

Type: fcf::TypeIndex

Class: fcf::TypeInfo

Package: fcfBasis

File: bits/PartType/TypeInfoDefinition.hpp

Available from version: 1.0.1

Unique identifier for the type

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(); std::cout << "int type: " << std::endl; std::cout << " Index: " << ti->index << std::endl; std::cout << " Hex index: " << std::hex << ti->index << std::dec << std::endl; } { const fcf::TypeInfo* ti = fcf::Type<int*>().typeInfo(); std::cout << "int* type: " << std::endl; std::cout << " Index: " << ti->index << std::endl; std::cout << " Hex index: " << std::hex << ti->index << std::dec << std::endl; } { const fcf::TypeInfo* ti = fcf::Type<const int>().typeInfo(); std::cout << "const int type: " << std::endl; std::cout << " Index: " << ti->index << std::endl; std::cout << " Hex index: " << std::hex << ti->index << std::dec << std::endl; } return 0; }

Output:

int type: Index: 5 Hex index: 5 int* type: Index: 268435461 Hex index: 10000005 const int type: Index: 134217733 Hex index: 8000005