System::Collections::Generic::BaseEnumerator 类

BaseEnumerator class

Enumerator definition to wrap STL-styled types for C#-styled usage. Makes no assertions on container structure except for existance of sequental iterator. Uses begin() and end() functions. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

template<typename Container,typename Element>class BaseEnumerator : public System::Collections::Generic::IEnumerator<Element>
参数描述
容器STL 风格的容器类型。
Element元素类型。

方法

方法描述
BaseEnumerator(const Object::ptr&, Container&)初始化迭代器。
IsValid() const检查是否已调用 MoveNext() 且未到达末尾。
MoveNext() override枚举器式递增。
Reset() override重置枚举器以允许重新枚举元素。

另见