Module bindgen::ir::template

source ·
Expand description

Template declaration and instantiation related things.

The nomenclature surrounding templates is often confusing, so here are a few brief definitions:

  • “Template definition”: a class/struct/alias/function definition that takes generic template parameters. For example:
template<typename T>
class List<T> {
    // ...
};
  • “Template instantiation”: an instantiation is a use of a template with concrete template arguments. For example, List<int>.

  • “Template specialization”: an alternative template definition providing a custom definition for instantiations with the matching template arguments. This C++ feature is unsupported by bindgen. For example:

template<>
class List<int> {
    // Special layout for int lists...
};

Structs

A concrete instantiation of a generic template.

Traits

A trait for things which may or may not be a named template type parameter.
Template declaration (and such declaration’s template parameters) related methods.