We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
isEmpty
InlineArray
1 parent 428d269 commit d0bab40Copy full SHA for d0bab40
stdlib/public/core/InlineArray.swift
@@ -276,6 +276,16 @@ extension InlineArray where Element: ~Copyable {
276
count
277
}
278
279
+ /// A Boolean value indicating whether the array is empty.
280
+ ///
281
+ /// - Complexity: O(1)
282
+ @available(SwiftStdlib 6.2, *)
283
+ @_alwaysEmitIntoClient
284
+ @_transparent
285
+ public var isEmpty: Bool {
286
+ count == 0
287
+ }
288
+
289
/// The position of the first element in a nonempty array.
290
///
291
/// If the array is empty, `startIndex` is equal to `endIndex`.
0 commit comments