FX::Generic::Traits< type > Class Template Reference
[Generic Tools in TnFOX]

#include <FXGenericTools.h>

Inheritance diagram for FX::Generic::Traits< type >:

FX::Generic::TraitsBasic< type > List of all members.

Detailed Description

template<typename type>
class FX::Generic::Traits< type >

Determines qualities of a type via introspection.

This is an amazingly useful class. It is divided into two parts, FX::Generic::TraitsBasic and FX::Generic::Traits with the basic base class providing all the commonly used (and least compiler demanding) traits. If you can, use TraitsBasic where possible.

You may also find FX::Generic::FnInfo useful for working with function pointers when isFunctionPtr is true. Traits provided by TraitsBasic:

Furthermore, the following types are defined: More advanced traits not provided by TraitsBasic (note that these require more compiler time and require fully known types ie; not just predeclarations): What is the best type for passing as a parameter? Well basic types like int and pointers should be passed as-is along with enums whereas structures, classes, arrays etc. should be passed by reference for efficiency. asROParam only applies const when the parameter type permits altering of external data (except for enums, just in case isEnum is misdiagnosed). Convertibility is always maintained (ie; so the compiler can always convert your type to asRWParam or asROParam) so this is ideal for compile-time parameter specification.

Notes:

isPOD currently only becomes true if isBasic is true as there is no way currently in the ISO C++ standard to determine if a class is POD. You can manually specify PODness using FX::Generic::ClassTraits.

Definition at line 1497 of file FXGenericTools.h.

Public Types

typedef leastIndir< type
>::value 
baseType
typedef select< isIntegral||isIndirect, type, typename
addRef< type >::value >::value 
asRWParam
typedef addConstI<!isIntegral
&&!isRef, type >::value 
asConstParam
typedef TL::at< ROParams,
((isValue &&isBasic)||isRef)?0:(isIndirect)?1:2 >::value 
asROParam

Static Public Attributes

static const bool isEnum
static const bool isPolymorphic
static const bool isVoid
static const bool isPtr
static const bool isRef
static const bool isPtrToCode
static const bool isMemberPtr
static const bool isFunctionPtr
static const bool isValue
static const bool isIndirect
static const bool isConst
static const bool isVolatile
static const bool isArray
static const bool isFloat
static const bool isInt
static const bool isSigned
static const bool isUnsigned
static const bool isArithmetical
static const bool isIntegral
static const bool isBasic
static const bool holdsData
static const bool isPOD

Protected Types

typedef FnInfo< type > fnInfo


The documentation for this class was generated from the following file:
(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:37:58 2009 for TnFOX by doxygen v1.4.7