-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathNBKFlexibleWidth+Update.swift
More file actions
29 lines (23 loc) · 1.2 KB
/
Copy pathNBKFlexibleWidth+Update.swift
File metadata and controls
29 lines (23 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//=----------------------------------------------------------------------------=
// This source file is part of the Numberick open source project.
//
// Copyright (c) 2023 Oscar Byström Ericsson
// Licensed under Apache License, Version 2.0
//
// See http://www.apache.org/licenses/LICENSE-2.0 for license information.
//=----------------------------------------------------------------------------=
import NBKCoreKit
//*============================================================================*
// MARK: * NBK x Flexible Width x Update x Unsigned
//*============================================================================*
extension NBKFlexibleWidth.Magnitude {
//=------------------------------------------------------------------------=
// MARK: Transformations
//=------------------------------------------------------------------------=
@inlinable public mutating func update(_ value: Self) {
self.storage.elements.replaceSubrange(self.storage.elements.indices, with: value.storage.elements)
}
@inlinable public mutating func update(_ value: Digit) {
self.storage.elements.replaceSubrange(self.storage.elements.indices, with: CollectionOfOne(value))
}
}