mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[interop][SwiftToCxx] experimentally expose exposable Swift's Array members to C++
This commit is contained in:
@@ -42,5 +42,18 @@ int main() {
|
||||
UseArray::printArray(UseArray::passthroughArray(val));
|
||||
}
|
||||
// CHECK: [2, 2]
|
||||
{
|
||||
auto val = Array<int>::init();
|
||||
val.append(-11);
|
||||
UseArray::printArray(val);
|
||||
assert(val.getCount() == 1);
|
||||
assert(val.getCapacity() >= 1);
|
||||
auto firstInt = val.remove(0);
|
||||
assert(firstInt == -11);
|
||||
assert(val.getCount() == 0);
|
||||
UseArray::printArray(val);
|
||||
}
|
||||
// CHECK-NEXT: [-11]
|
||||
// CHECK-NEXT: []
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user