IVector<TValue> IVector<TValue> IVector<TValue> IVector<TValue> Interface

定义

定义 STL/CLR vector 对象的接口。Defines the interface for an STL/CLR vector object.

generic <typename TValue>
public interface class IVector : ICloneable, Microsoft::VisualC::StlClr::Generic::IRandomAccessContainer<TValue>, System::Collections::ICollection
public interface IVector<TValue> : ICloneable, Microsoft.VisualC.StlClr.Generic.IRandomAccessContainer<TValue>, System.Collections.ICollection
type IVector<'Value> = interface
    interface IRandomAccessContainer<'Value>
    interface ICloneable
    interface ICollection
    interface IEnumerable
Public Interface IVector(Of TValue)
Implements ICloneable, ICollection, IRandomAccessContainer(Of TValue)

类型参数

TValue

受控序列中的元素的类型。The type of an element in the controlled sequence.

实现

注解

有些方法(尤其是运算符)声明参数的类型,但不指定参数名称。Some methods, especially operators, declare a type for a parameter but do not specify a parameter name. 此类参数称为“未命名参数” 。Such a parameter is known as an unnamed parameter. 在这些方法的文档中,__unnamed0 占位符表示未命名参数。In the documentation for these methods, the __unnamed0 placeholder represents the unnamed parameter.

属性

back_item back_item back_item back_item

访问容器的最后一个元素。Accesses the last element of the container.

Count Count Count Count

获取 ICollection 中包含的元素数。Gets the number of elements contained in the ICollection.

(Inherited from ICollection)
front_item front_item front_item front_item

访问容器的第一个元素。Accesses the first element of the container.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

获取一个值,该值指示是否同步对 ICollection 的访问(线程安全)。Gets a value indicating whether access to the ICollection is synchronized (thread safe).

(Inherited from ICollection)
Item[Int32] Item[Int32] Item[Int32] Item[Int32]

访问容器中指定位置的元素。Accesses an element at a specified position in the container.

SyncRoot SyncRoot SyncRoot SyncRoot

获取可用于同步对 ICollection 的访问的对象。Gets an object that can be used to synchronize access to the ICollection.

(Inherited from ICollection)

方法

assign(IEnumerable) assign(IEnumerable) assign(IEnumerable) assign(IEnumerable)

用指定枚举中的元素替换容器中的所有元素。Replaces all elements in the container with the elements in the specified enumeration.

assign(IInputIterator<TValue>, IInputIterator<TValue>) assign(IInputIterator<TValue>, IInputIterator<TValue>) assign(IInputIterator<TValue>, IInputIterator<TValue>) assign(IInputIterator<TValue>, IInputIterator<TValue>)

用给定迭代器之间的元素替换容器中的所有元素。Replaces all elements in the container with the elements between the given iterators.

assign(Int32, TValue) assign(Int32, TValue) assign(Int32, TValue) assign(Int32, TValue)

用指定数量的具有给定值的元素替换容器中的所有元素。Replaces all elements in the container with the specified number of elements that have given values.

at(Int32) at(Int32) at(Int32) at(Int32)

访问容器中指定位置的元素。Accesses an element at a specified position in the container.

at_bias(Int32) at_bias(Int32) at_bias(Int32) at_bias(Int32)

获取容器中位于当前偏移处的元素。Gets the element at the current bias of the container. 偏移是相对于当前元素零的偏移量。The bias is the offset from the current element zero.

(Inherited from IRandomAccessContainer<TValue>)
back() back() back() back()

访问容器的最后一个元素。Accesses the last element of the container.

begin(ContainerRandomAccessIterator<TValue>) begin(ContainerRandomAccessIterator<TValue>) begin(ContainerRandomAccessIterator<TValue>) begin(ContainerRandomAccessIterator<TValue>)

指定受控序列的开头。Designates the beginning of the controlled sequence.

capacity() capacity() capacity() capacity()

报告为容器分配的存储大小。Reports the size of allocated storage for the container.

clear() clear() clear() clear()

从容器中移除所有元素。Removes all elements from the container.

Clone() Clone() Clone() Clone()

创建作为当前实例副本的新对象。Creates a new object that is a copy of the current instance.

(Inherited from ICloneable)
CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

从特定的 ICollection 索引开始,将 Array 的元素复制到一个 Array 中。Copies the elements of the ICollection to an Array, starting at a particular Array index.

(Inherited from ICollection)
empty() empty() empty() empty()

测试容器中是否没有元素。Tests whether the container has no elements.

end(ContainerRandomAccessIterator<TValue>) end(ContainerRandomAccessIterator<TValue>) end(ContainerRandomAccessIterator<TValue>) end(ContainerRandomAccessIterator<TValue>)

指定受控序列的末尾。Designates the end of the controlled sequence.

erase(ContainerRandomAccessIterator<TValue>, ContainerRandomAccessIterator<TValue>) erase(ContainerRandomAccessIterator<TValue>, ContainerRandomAccessIterator<TValue>) erase(ContainerRandomAccessIterator<TValue>, ContainerRandomAccessIterator<TValue>) erase(ContainerRandomAccessIterator<TValue>, ContainerRandomAccessIterator<TValue>)

删除受控序列中由 _Where 指向的单个元素。Removes the single element of the controlled sequence that is pointed to by _Where.

erase(ContainerRandomAccessIterator<TValue>, ContainerRandomAccessIterator<TValue>, ContainerRandomAccessIterator<TValue>) erase(ContainerRandomAccessIterator<TValue>, ContainerRandomAccessIterator<TValue>, ContainerRandomAccessIterator<TValue>) erase(ContainerRandomAccessIterator<TValue>, ContainerRandomAccessIterator<TValue>, ContainerRandomAccessIterator<TValue>) erase(ContainerRandomAccessIterator<TValue>, ContainerRandomAccessIterator<TValue>, ContainerRandomAccessIterator<TValue>)

删除 [_First_iter, _Last_iter] 范围内受控序列的元素。Removes the elements of the controlled sequence in the range [_First_iter, _Last_iter].

front() front() front() front()

访问容器的第一个元素。Accesses the first element of the container.

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

返回循环访问集合的枚举数。Returns an enumerator that iterates through a collection.

(Inherited from IEnumerable)
get_generation() get_generation() get_generation() get_generation()

获取基础容器的当前换代。Gets the current change generation of the underlying container.

insert(ContainerRandomAccessIterator<TValue>, ContainerRandomAccessIterator<TValue>, TValue) insert(ContainerRandomAccessIterator<TValue>, ContainerRandomAccessIterator<TValue>, TValue) insert(ContainerRandomAccessIterator<TValue>, ContainerRandomAccessIterator<TValue>, TValue) insert(ContainerRandomAccessIterator<TValue>, ContainerRandomAccessIterator<TValue>, TValue)

将指定的值插入到容器中。Inserts the specified value into the container.

insert(ContainerRandomAccessIterator<TValue>, IEnumerable) insert(ContainerRandomAccessIterator<TValue>, IEnumerable) insert(ContainerRandomAccessIterator<TValue>, IEnumerable) insert(ContainerRandomAccessIterator<TValue>, IEnumerable)

将枚举器指定的序列插入到容器中。Inserts the sequence that is designated by an enumerator into the container.

insert(ContainerRandomAccessIterator<TValue>, IInputIterator<TValue>, IInputIterator<TValue>) insert(ContainerRandomAccessIterator<TValue>, IInputIterator<TValue>, IInputIterator<TValue>) insert(ContainerRandomAccessIterator<TValue>, IInputIterator<TValue>, IInputIterator<TValue>) insert(ContainerRandomAccessIterator<TValue>, IInputIterator<TValue>, IInputIterator<TValue>)

将以 _First 开头并以 _Last 之前的元素结尾的序列插入到容器中。Inserts the sequence beginning with _First and ending with the element preceding _Last into the container.

insert(ContainerRandomAccessIterator<TValue>, Int32, TValue) insert(ContainerRandomAccessIterator<TValue>, Int32, TValue) insert(ContainerRandomAccessIterator<TValue>, Int32, TValue) insert(ContainerRandomAccessIterator<TValue>, Int32, TValue)

将指定的值插入到容器中。Inserts the specified value into the container.

pop_back() pop_back() pop_back() pop_back()

从容器中移除最后一个元素。Removes the last element from the container.

push_back(TValue) push_back(TValue) push_back(TValue) push_back(TValue)

将一个新元素添加到容器的末尾。Adds a new element to the end of the container.

rbegin(ReverseRandomAccessIterator<TValue>) rbegin(ReverseRandomAccessIterator<TValue>) rbegin(ReverseRandomAccessIterator<TValue>) rbegin(ReverseRandomAccessIterator<TValue>)

指定反向受控序列的开头。Designates the beginning of the reversed controlled sequence.

rend(ReverseRandomAccessIterator<TValue>) rend(ReverseRandomAccessIterator<TValue>) rend(ReverseRandomAccessIterator<TValue>) rend(ReverseRandomAccessIterator<TValue>)

指定反向受控序列的末尾。Designates the end of the reversed controlled sequence.

reserve(Int32) reserve(Int32) reserve(Int32) reserve(Int32)

保留存储以确保容器的最小增长容量。Reserves storage to ensure the minimum growth capacity for the container.

resize(Int32) resize(Int32) resize(Int32) resize(Int32)

将容器中的元素数更改为指定大小。Changes the number of elements in the container to the specified size.

resize(Int32, TValue) resize(Int32, TValue) resize(Int32, TValue) resize(Int32, TValue)

将容器中的元素数更改为指定大小。Changes the number of elements in the container to the specified size. 如果新大小大于旧大小,则该方法将追加值为 _Val 的元素。If the new size is larger than the old size, the method appends elements that have value _Val.

size() size() size() size()

计算容器中的元素数。Counts the number of elements in the container.

swap(IVector<TValue>) swap(IVector<TValue>) swap(IVector<TValue>) swap(IVector<TValue>)

交换两个容器的内容。Swaps the contents of two containers.

valid_bias(Int32) valid_bias(Int32) valid_bias(Int32) valid_bias(Int32)

确定给定偏移对容器是否有效。Determines if a given bias is valid for the container. 偏移是相对于当前元素零的偏移量。The bias is the offset from the current element zero.

(Inherited from IRandomAccessContainer<TValue>)

扩展方法

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于