mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This adds a setter to the `CxxDictionary` subscript which makes it possible to mutate `std::map` and `std::unordered_map` from Swift. rdar://105399019
16 lines
483 B
C++
16 lines
483 B
C++
#ifndef TEST_INTEROP_CXX_STDLIB_INPUTS_STD_MAP_H
|
|
#define TEST_INTEROP_CXX_STDLIB_INPUTS_STD_MAP_H
|
|
|
|
#include <map>
|
|
#include <unordered_map>
|
|
#include <string>
|
|
|
|
using Map = std::map<int, int>;
|
|
using MapStrings = std::map<std::string, std::string>;
|
|
using UnorderedMap = std::unordered_map<int, int>;
|
|
|
|
inline Map initMap() { return {{1, 3}, {2, 2}, {3, 3}}; }
|
|
inline UnorderedMap initUnorderedMap() { return {{1, 3}, {3, 3}, {2, 2}}; }
|
|
|
|
#endif // TEST_INTEROP_CXX_STDLIB_INPUTS_STD_MAP_H
|