HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openvdb::OPENVDB_VERSION_NAME::TypeList< Ts > Struct Template Reference

A list of types (not necessarily unique) More...

#include <Types.h>

Public Types

using Self = TypeList
 The type of this list. More...
 
template<typename... TypesToAppend>
using Append = typename internal::TSAppendImpl< Self, TypesToAppend...>::type
 Append types, or the members of another TypeList, to this list. More...
 
template<typename... TypesToRemove>
using Remove = typename internal::TSRemoveImpl< Self, TypesToRemove...>::type
 Remove all occurrences of one or more types, or the members of another TypeList, from this list. More...
 

Static Public Member Functions

template<typename OpT >
static void foreach (OpT op)
 Invoke a templated, unary functor on a value of each type in this list. More...
 

Detailed Description

template<typename... Ts>
struct openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >

A list of types (not necessarily unique)

Example:

using MyTypes = openvdb::TypeList<int, float, int, double, float>;

Definition at line 439 of file Types.h.

Member Typedef Documentation

template<typename... Ts>
template<typename... TypesToAppend>
using openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >::Append = typename internal::TSAppendImpl<Self, TypesToAppend...>::type

Append types, or the members of another TypeList, to this list.

Example:

{
using IntTypes = openvdb::TypeList<Int16, Int32, Int64>;
using RealTypes = openvdb::TypeList<float, double>;
using NumericTypes = IntTypes::Append<RealTypes>;
}
{
using IntTypes = openvdb::TypeList<Int16>::Append<Int32, Int64>;
using NumericTypes = IntTypes::Append<float>::Append<double>;
}

Definition at line 458 of file Types.h.

template<typename... Ts>
template<typename... TypesToRemove>
using openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >::Remove = typename internal::TSRemoveImpl<Self, TypesToRemove...>::type

Remove all occurrences of one or more types, or the members of another TypeList, from this list.

Example:

{
using NumericTypes = openvdb::TypeList<float, double, Int16, Int32, Int64>;
using LongTypes = openvdb::TypeList<Int64, double>;
using ShortTypes = NumericTypes::Remove<LongTypes>; // float, Int16, Int32
}

Definition at line 471 of file Types.h.

template<typename... Ts>
using openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >::Self = TypeList

The type of this list.

Definition at line 442 of file Types.h.

Member Function Documentation

template<typename... Ts>
template<typename OpT >
static void openvdb::OPENVDB_VERSION_NAME::TypeList< Ts >::foreach ( OpT  op)
inlinestatic

Invoke a templated, unary functor on a value of each type in this list.

Example:

#include <typeinfo>
template<typename ListT>
void printTypeList()
{
auto op = [&](auto x) { // C++14
std::cout << sep << typeid(decltype(x)).name(); sep = ", "; };
}
using MyTypes = openvdb::TypeList<int, float, double>;
printTypeList<MyTypes>(); // "i, f, d" (exact output is compiler-dependent)
Note
The functor object is passed by value. Wrap it with std::ref to use the same object for each type.

Definition at line 494 of file Types.h.


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