System::Collections::Generic::_KeyCollection 类

_KeyCollection class

Dictionary 的键集合。引用集合,不复制任何内容。此类的对象只能使用 System::MakeObject() 函数分配。切勿在栈上或使用 operator new 创建此类型的实例,因为这会导致运行时错误和/或断言失败。始终将此类包装到 System::SmartPtr 指针中,并使用该指针将其作为参数传递给函数。

template<typename Dict>class _KeyCollection : public System::Collections::Generic::BaseKVCollection<Dict, Dict::map_t::key_type>

Nested classes

方法

方法描述
_KeyCollection(const typename Dict::Ptr&)初始化引用指定字典的集合。
Contains(const TKey&) const override检查容器中是否存在该项。
GetEnumerator() override获取遍历键的枚举器。
idx_get(int) const override实现了 IList 方法。不受支持。
virtualizeBeginConstIterator() const override获取当前容器的 begin const 迭代器的实现。
virtualizeBeginIterator() override获取当前容器的 begin 迭代器的实现。
virtualizeEndConstIterator() const override获取当前容器的 end const 迭代器的实现。
virtualizeEndIterator() override获取当前容器的 end 迭代器的实现。

Typedefs

类型定义描述
TKey密钥类型。

另见