mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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.
20 lines
667 B
Swift
20 lines
667 B
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
public protocol CxxPair<First, Second> {
|
|
associatedtype First
|
|
associatedtype Second
|
|
|
|
var first: First { get }
|
|
var second: Second { get }
|
|
}
|