Commit Graph

4 Commits

Author SHA1 Message Date
Egor Zhdan
6caaa77efc [cxx-interop] Allow mutating std::map from Swift
This adds a setter to the `CxxDictionary` subscript which makes it possible to mutate `std::map` and `std::unordered_map` from Swift.

rdar://105399019
2023-08-02 16:44:30 +01:00
Egor Zhdan
4ca1eeb141 [cxx-interop] Make CxxPair's fields mutable
This will be needed to support mutable C++ iterators, e.g. `std::map::iterator`.
2023-07-19 16:05:28 +01:00
Egor Zhdan
7ca1b5c5eb [cxx-interop] NFC: Add doc comments for overlay protocols 2023-07-12 19:10:23 +01:00
Egor Zhdan
919eea7045 [cxx-interop] Add CxxDictionary protocol for std::map ergonomics
This adds a protocol to the C++ standard library overlay which will improve the ergonomics of `std::map` and `std::unordered_map` when used from Swift code.

As of now, `CxxDictionary` adds a subscript with an optional return type that mimics the subscript of `Swift.Dictionary`.

Similar to https://github.com/apple/swift/pull/63244.
2023-02-09 14:31:06 +00:00