OpenVDB: TypeList< Ts > Struct Template Reference

OpenVDB 7.0.0

Public Types | Static Public Member Functions | List of all members
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::v7_0::TypeList< Ts >

A list of types (not necessarily unique)

Example:

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

## Member Typedef Documentation

## ◆ Append

using 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>;
}

## ◆ Remove

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.

Example:

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

## ◆ Self

using Self = TypeList

The type of this list.

## Member Function Documentation

## ◆ foreach()

static void 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()
{
std::string sep;
auto op = [&](auto x) { // C++14
std::cout << sep << typeid(decltype(x)).name(); sep = ", "; };
ListT::foreach(op);
}
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.

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

- Types.h

openvdb::v7_0::tools::foreach
void foreach(const IterT &iter, XformOp &op, bool threaded=true, bool shareOp=true)
Definition: ValueTransformer.h:374
openvdb::v7_0::Int64
int64_t Int64
Definition: Types.h:34
openvdb::v7_0::TypeList
A list of types (not necessarily unique)
Definition: Types.h:389
openvdb::v7_0::Int32
int32_t Int32
Definition: Types.h:33