Edit

Share via


Platform::Collections Namespace

The Platform::Collections namespace contains the Map, MapView, Vector, and VectorView classes. These classes are concrete implementations of the corresponding interfaces that are defined in the Windows::Foundation::Collections namespace. The concrete collection types are not portable across the ABI (for example when a Javascript or C# program calls into a C++ component), but they are implicitly convertible to their corresponding interface types. For example, if you implement a public method that populates and returns a collection, then use Platform::Collections::Vector to implement the collection internally and use Windows::Foundation::Collections::IVector as the return type. For more information, see Collections and Creating Windows Runtime Components in C++.

You can construct a Platform::Collections::Vector from a std::vector and a Platform::Collections::Map from a std::map.

In addition, the Platform::Collections namespace provides support for back insert and input iterators, and Vector and VectorView iterators.

You must include (#include) the collection.h header to use the types in the Platform::Collections namespace.

Syntax

#include <collection.h>
using namespace Platform::Collections;

Members

This namespace contains the following members.

Name Description
Platform::Collections::BackInsertIterator Class Represents an iterator that inserts an element at the end of a collection.
Platform::Collections::InputIterator Class Represents an iterator that inserts an element at the beginning of a collection.
Platform::Collections::Map Class Represents a modifiable collection of key-value pairs that are accessed by a key. Similar to std::map.
Platform::Collections::MapView Class Represents a read-only collection of key-value pairs that are accessed by a key.
Platform::Collections::Vector Class Represents a modifiable sequence of elements. Similar to std::vector.
Platform::Collections::VectorIterator Class Represents an iterator that traverses a Vector collection.
Platform::Collections::VectorView Class Represents a read-only sequence of elements.
Platform::Collections::VectorViewIterator Class Represents an iterator that traverses a VectorView collection.

Inheritance hierarchy

Platform namespace

Requirements

Metadata: platform.winmd

Namespace: Platform::Collections

Compiler option: /ZW

See also

Platform Namespace