IList<TValue>.assign 方法

定义

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

重载

assign(IEnumerable)

用给定枚举器指定的序列替换受控序列。Replaces the controlled sequence with the sequence that is designated by the given enumerator.

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

将受控序列替换为序列[ _First _Last ) Replaces the controlled sequence with the sequence [_First,_Last).

assign(Int32, TValue)

用指定数量的给定元素替换受控序列。Replaces the controlled sequence with the specified number of the given element.

注解

有关详细信息,请参阅 list:: assign (STL/CLR) For more information, see list::assign (STL/CLR).

assign(IEnumerable)

用给定枚举器指定的序列替换受控序列。Replaces the controlled sequence with the sequence that is designated by the given enumerator.

public:
 void assign(System::Collections::IEnumerable ^ _Right);
public void assign (System.Collections.IEnumerable _Right);
abstract member assign : System.Collections.IEnumerable -> unit
Public Sub assign (_Right As IEnumerable)

参数

_Right
IEnumerable

要将其元素插入到容器中的枚举。The enumeration whose elements are to be inserted into the container.

注解

有关详细信息,请参阅 list:: assign (STL/CLR) For more information, see list::assign (STL/CLR).

适用于

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

将受控序列替换为序列[ _First _Last ) Replaces the controlled sequence with the sequence [_First,_Last).

public:
 void assign(Microsoft::VisualC::StlClr::Generic::IInputIterator<TValue> ^ _First, Microsoft::VisualC::StlClr::Generic::IInputIterator<TValue> ^ _Last);
public void assign (Microsoft.VisualC.StlClr.Generic.IInputIterator<TValue> _First, Microsoft.VisualC.StlClr.Generic.IInputIterator<TValue> _Last);
abstract member assign : Microsoft.VisualC.StlClr.Generic.IInputIterator<'Value> * Microsoft.VisualC.StlClr.Generic.IInputIterator<'Value> -> unit
Public Sub assign (_First As IInputIterator(Of TValue), _Last As IInputIterator(Of TValue))

参数

_First
IInputIterator<TValue>

要插入到容器中的元素范围的开始位置。The beginning position of the range of elements to insert into the container.

_Last
IInputIterator<TValue>

要插入到容器中的元素范围之外的第一个位置。The first position beyond the range of elements to insert into the container.

注解

有关详细信息,请参阅 list:: assign (STL/CLR) For more information, see list::assign (STL/CLR).

适用于

assign(Int32, TValue)

用指定数量的给定元素替换受控序列。Replaces the controlled sequence with the specified number of the given element.

public:
 void assign(int _Count, TValue _Val);
public void assign (int _Count, TValue _Val);
abstract member assign : int * 'Value -> unit
Public Sub assign (_Count As Integer, _Val As TValue)

参数

_Count
Int32

要插入到容器中的元素数。The number of elements to insert into the container.

_Val
TValue

要插入到容器中的元素的值。The value of the elements to insert into the container.

注解

有关详细信息,请参阅 list:: assign (STL/CLR) For more information, see list::assign (STL/CLR).

适用于