Skip to content

Commit b120e61

Browse files
committed
[se-0426] remove deprecation, and explain the omission
1 parent 3a72012 commit b120e61

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

proposals/0426-bitwise-copyable.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ public func storeBytes<T : BitwiseCopyable>(
283283

284284
This allows for optimal code generation because `memcpy` instead of value witnesses can be used.
285285

286-
Additionally, we propose deprecating the original, unconstrained overloads of `loadUnaligned` and `storeBytes`.
286+
The pre-existing methods will continue to exist (see [alternatives considered](#deprecation).)
287287

288288
## Effect on ABI stability
289289

@@ -383,6 +383,10 @@ If, in a subsequent proposal, the protocol were redefined as a composition, symb
383383

384384
**Trivial** is widely used within the compiler and Swift evolution discussions to refer to the property of bitwise copyability. `BitwiseCopyable`, on the other hand, is more self-documenting.
385385

386+
### Deprecation of unconstrained functions dependent on `isPOD`<a name="deprecation"></a>
387+
388+
The standard library has a few pre-existing functions that receive a generic bitwise-copyable value as a parameter. These functions work with types for which the `_isPOD()` function returns true, even though they do not have a `BitwiseCopyable` conformance. If we were to deprecate these unconstrained versions, we would add unresolvable warnings to some of the codebases that use them. For example, they might use types that could be conditionally `BitwiseCopyable`, but come from a module whose types have not been conformed to `BitwiseCopyable` by their author. Furthermore, as explained [above](#transient-and-permanent), it is not necessarily the case that a transiently bitwise-copyable type can be permanently annotated as `BitwiseCopyable`.
389+
386390
## Acknowledgments
387391

388392
This proposal has benefitted from discussions with John McCall, Joe Groff, Andrew Trick, Michael Gottesman, and Arnold Schwaigofer.

0 commit comments

Comments
 (0)