ArgIterator 结构

定义

表示变长参数列表;即采用可变数量的参数的函数的参数。Represents a variable-length argument list; that is, the parameters of a function that takes a variable number of arguments.

public value class ArgIterator
public struct ArgIterator
type ArgIterator = struct
Public Structure ArgIterator
继承
ArgIterator

注解

编写编译器的开发人员使用 ArgIterator 结构来枚举参数列表中的必需参数和可选参数。Developers who write compilers use the ArgIterator structure to enumerate the mandatory and optional arguments in an argument list. 对于编译器以外的应用程序,ArgIterator 结构通常不适用。The ArgIterator structure is not generally useful for applications other than compilers.

ArgIterator 结构中的功能通常在特定编程语言的语法中隐藏。The functionality in the ArgIterator structure is typically hidden in the syntax of a specific programming language. 例如,在C++编程语言中,通过在参数列表的末尾指定省略号("...")来声明一个可变长度参数列表。For example, in the C++ programming language you declare a variable-length argument list by specifying an ellipsis ("...") at the end of the argument list. 当开发语言不提供对访问可变长度参数的直接支持时,ArgIterator 结构主要非常有用。The ArgIterator structure is useful primarily when a development language does not provide direct support for accessing variable-length parameters.

构造函数

ArgIterator(RuntimeArgumentHandle)

使用指定的参数列表初始化 ArgIterator 结构的新实例。Initializes a new instance of the ArgIterator structure using the specified argument list.

ArgIterator(RuntimeArgumentHandle, Void*)

使用指定的参数列表和指向列表项的指针来初始化 ArgIterator 结构的新实例。Initializes a new instance of the ArgIterator structure using the specified argument list and a pointer to an item in the list.

方法

End()

结束由此实例表示的变长参数列表的处理。Concludes processing of the variable-length argument list represented by this instance.

Equals(Object)

此方法不受支持,它始终会引发 NotSupportedExceptionThis method is not supported, and always throws NotSupportedException.

GetHashCode()

返回此对象的哈希代码。Returns the hash code of this object.

GetNextArg()

返回变长参数列表中的下一参数。Returns the next argument in a variable-length argument list.

GetNextArg(RuntimeTypeHandle)

返回变长参数列表中具有指定类型的下一个参数。Returns the next argument in a variable-length argument list that has a specified type.

GetNextArgType()

返回下一个参数的类型。Returns the type of the next argument.

GetRemainingCount()

返回参数列表中剩余参数的个数。Returns the number of arguments remaining in the argument list.

适用于