This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Dictionary { | |
/// Combine two dictionaries of same type with `+` operator. | |
/// | |
/// - Important: When `left` and `right` are having a same key, the value from `right` will override | |
/// the value from `left`. E.g. | |
/// ``` | |
/// var left = ["a": 1, "b": 2] | |
/// let right = ["a": 3, "c": 4] | |
/// left += right | |
/// print(left) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func += <T>(left: inout [T], right: T) { | |
left.append(right) | |
} |
NewerOlder