Files
swift-collections/Sources/PersistentCollections/PersistentDictionary+Values.swift
T

23 lines
804 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2022 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
//
//===----------------------------------------------------------------------===//
// TODO: implement a custom `Values` view rather than relying on an array representation
extension PersistentDictionary {
/// A view of a dictionary’s values.
public typealias Values = [Value]
/// A collection containing just the values of the dictionary.
@inlinable
public var values: Self.Values /* { get set } */ {
self.map { $0.value }
}
}