Represents a map, which is a collection of key-value pairs.
template < typename K, typename V, typename C = std::less<K> > ref class Map sealed;
Allowed types are:
-
integers
-
interface class ^
-
public ref class^
-
value struct
-
public enum class
Map is the C++ concrete implementation of the Windows::Foundation::Collections::IMap and IObservableMap types that is passed across public Windows Runtime interfaces. If you try to use a Map type in a public return value or parameter, compiler error C3986 is raised. You can fix the error by changing the type of the parameter or return value to Windows::Foundation::Collections::IMap.
For more information, see Collections (C++/CX).
Public Constructors
|
Name |
Description |
|---|---|
|
Initializes a new instance of the Map class. |
Public Methods
|
Name |
Description |
|---|---|
|
Removes all key-value pairs from the current Map object. |
|
|
Returns an iterator that specifies the first element in the map. |
|
|
Returns a read-only view of the current Map; that is, a Platform::Collections::MapView Class. |
|
|
Determines whether the current Map contains the specified key. |
|
|
Adds the specified key-value pair to the current Map object. |
|
|
Retrieves the element at the specified key in the current Map object. |
|
|
Deletes the specified key-value pair from the current Map object. |
|
|
Returns the number of elements in the current Map object. |
Events
|
Name |
Description |
|
event Windows::Foundation::Collections::MapChangedEventHandler<K, V>^ MapChanged |
Occurs when the Map changes. |