Skip to content

GenericTypeInstSig

Raymond Chen edited this page Mar 30, 2019 · 1 revision

A xlang::meta::reader::GenericTypeInstSig structure represents an instantiation of a generic type.

Example:

Windows.Foundation.Collections.IVector<Windows.System.User> is represented as follows:

  • ClassOrValueType() is ElementType::Class
  • GenericType() is TypeRef(Windows.Foundation.Collections.IVector`2). Note that the type name is followed by a backtick and the number of generic arguments.
  • GenericArgCount() is 1.
  • GenericArgs() has only one element: TypeSig(Windows.System.User).

Methods

ClassOrValueType()

xlang::meta::reader::ElementType ClassOrValueType() const noexcept;

Returns an ElementType that identifies whether the generic type is of class or value type. It will be either ElementType::ValueType or ElementType::Class.

Complexity: O(1)

GenericType

xlang::meta::reader::coded_index<TypeDefOrRef> GenericType() const noexcept;

Returns a coded_index<TypeDefOrRef> that identifies the generic type itself.

Complexity: O(1)

GenericArgCount

uint32_t GenericArgCount() const noexcept;

Returns the number of generic arguments. This is the same number that is suffixed to the GenericType name.

Complexity: O(1)

GenericArgs

std::pair<std::vector<xlang::meta::reader::TypeSig>::const_iterator,
          std::vector<xlang::meta::reader::TypeSig>::const_iterator>
GenericArgs() const noexcept;

Returns a range (pair of iterators) representing the types that form the generic arguments. The size of the range is equal to GenericArgCount().

Complexity: O(1).

Clone this wiki locally