Evo C++ Library v0.5.1
Classes | Public Types | List of all members
TypeId Struct Reference

#include <evo/meta.h>

Detailed Description

Type ID info (POD, ByteCopy, Normal).

#include <evo/type.h>

Example
#include <evo/type.h>
#include <evo/io.h>
using namespace evo;
// Example item types, declare Foo as a ByteCopy type
struct Foo { };
struct Bar { };
// Create MyClass specializations -- U is inferred from T
template<class T, class U=typename TypeId::Get<T>::Id>
struct MyClass {
static void print() {
con().out << "MyClass with Normal type" << NL;
}
};
template<class T>
struct MyClass<T, TypeId::Pod> {
static void print() {
con().out << "MyClass with POD type" << NL;
}
};
template<class T>
struct MyClass<T, TypeId::ByteCopy> {
static void print() {
con().out << "MyClass with ByteCopy type" << NL;
}
};
int main() {
MyClass<int>::print(); // POD type
MyClass<Foo>::print(); // ByteCopy type
MyClass<Bar>::print(); // Normal type
return 0;
};

Output:

MyClass with POD type
MyClass with ByteCopy type
MyClass with Normal type

Classes

struct  ByteCopy
 Used to identify ByteCopy types. More...
 
struct  Get
 Use to get type ID info for type T. More...
 
struct  GetFill
 Use to get type ID info for type T as for filling arrays/buffers. More...
 
struct  Normal
 Used to identify normal types (not POD, and not ByteCopy). More...
 
struct  Pod
 Used to identify POD (Plain Old Data) types. More...
 

Public Types

enum  Enum { POD = 0, BCOPY, NORMAL }
 Type ID enum values. More...
 

Member Enumeration Documentation

◆ Enum

enum Enum

Type ID enum values.

Enumerator
POD 

POD (Plain Old Data) type ID value.

BCOPY 

Byte-copy type ID value.

NORMAL 

Normal type ID value


The documentation for this struct was generated from the following file: