Share via


Platform::Collections::BackInsertIterator 类

表示一个迭代器,它插入而非重写元素到有序集合的后端。

语法

template <typename T>
class BackInsertIterator :
public ::std::iterator<::std::output_iterator_tag, void, void, void, void>;

参数

T
当前集合中项目的类型。

注解

BackInsertIterator 类实现 back_insert_iterator Class所要求的规则。

成员

公共构造函数

名称 描述
BackInsertIterator::BackInsertIterator 初始化 BackInsertIterator 类的新实例。

公共运算符

“属性” 描述
BackInsertIterator::operator* 运算符 检索对当前 BackInsertIterator 的引用。
BackInsertIterator::operator++ 运算符 返回对当前 BackInsertIterator 的引用。 迭代器未经修改。
BackInsertIterator::operator= 运算符 将指定对象追加到当前有序集合的末尾。

继承层次结构

BackInsertIterator

要求

标头: collection.h

命名空间: Platform::Collections

BackInsertIterator::BackInsertIterator 构造函数

初始化 BackInsertIterator 类的新实例。

语法

explicit BackInsertIterator(
   Windows::Foundation::Collections::IVector<T>^ v);

参数

v
一个 IVector<T> 对象。

备注

BackInsertIterator 在参数 v 指定的对象的最后一个元素之后插入元素。

BackInsertIterator::operator= 运算符

将指定对象追加到当前有序集合的末尾。

语法

BackInsertIterator& operator=( const T& t);

参数

t
要追加到当前集合的对象。

返回值

对当前 BackInsertIterator 的引用。

BackInsertIterator::operator* 运算符

检索对当前 BackInsertIterator 的引用。

语法

BackInsertIterator& operator*();

返回值

对当前 BackInsertIterator 的引用。

备注

此运算符返回对当前 BackInsertIterator 的引用;而不是对当前集合中任何元素的引用。

BackInsertIterator::operator++ 运算符

返回对当前 BackInsertIterator 的引用。 迭代器未经修改。

语法

BackInsertIterator& operator++();

BackInsertIterator operator++(int);

返回值

对当前 BackInsertIterator 的引用。

备注

按照设计,第一个语法示例前递增当前 BackInsertIterator,第二个语法后递增当前 BackInsertIterator。 第二个语法中的 int 类型指示后递增操作,而不是实际整数操作数。

但是,此运算符不会实际修改 BackInsertIterator, 而是返回对未经修改的当前迭代器的引用。 此行为与 operator* 相同。

另请参阅

Platform 命名空间