|
@@ -19,12 +19,12 @@
|
|
|
/// - parameter length: length of output array. By default size of value type
|
|
|
///
|
|
|
/// - returns: Array of bytes
|
|
|
-@_specialize(exported: true, where T == Int)
|
|
|
-@_specialize(exported: true, where T == UInt)
|
|
|
-@_specialize(exported: true, where T == UInt8)
|
|
|
-@_specialize(exported: true, where T == UInt16)
|
|
|
-@_specialize(exported: true, where T == UInt32)
|
|
|
-@_specialize(exported: true, where T == UInt64)
|
|
|
+@_specialize(where T == Int)
|
|
|
+@_specialize(where T == UInt)
|
|
|
+@_specialize(where T == UInt8)
|
|
|
+@_specialize(where T == UInt16)
|
|
|
+@_specialize(where T == UInt32)
|
|
|
+@_specialize(where T == UInt64)
|
|
|
func arrayOfBytes<T: FixedWidthInteger>(value: T, length totalBytes: Int = MemoryLayout<T>.size) -> Array<UInt8> {
|
|
|
let valuePointer = UnsafeMutablePointer<T>.allocate(capacity: 1)
|
|
|
valuePointer.pointee = value
|