mirror of
https://github.com/mii443/AzooKeyKanaKanjiConverter.git
synced 2025-08-22 15:05:26 +00:00
19 lines
526 B
Swift
19 lines
526 B
Swift
//
|
|
// WithMutableValue.swift
|
|
// azooKey
|
|
//
|
|
// Created by ensan on 2022/10/10.
|
|
// Copyright © 2022 ensan. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
/// Modifies the given value and returns the result.
|
|
/// - Parameters:
|
|
/// - value: The value to modify.
|
|
/// - process: The process to modify the value.
|
|
/// - Note: This function should be used when specific subscript setter is called for multiple times.
|
|
@inlinable public func withMutableValue<T>(_ value: inout T, process: (inout T) -> Void) {
|
|
process(&value)
|
|
}
|