[SR-12658] [C++] Reimplement std::vector in Swift as a generic struct #55101
Labels
c++ interop
Feature: Interoperability with C++
new feature
standard library
Area: Standard library umbrella
Additional Detail from JIRA
md5: 8824241c5c7c351f9abec39aedb4c5c0
Issue Description:
It is possible to import
std::vector
using our general strategy to import templates (import only full specializations), however, for a vocabulary type likestd::vector
that might be too limiting, as the imported type won't be usable with type variables.One idea is to reimplement
std::vector
in Swift: implement a generic Swift struct with identical memory layout tostd::vector
.Fortunately, in libc\\,
sizeof(std::vector<int>) == sizeof(std::vector<bool>)
, so all specializations have identical size. In libstdc++ that is not the case.I'm not sure this idea will work out well, but it is worth trying.
The text was updated successfully, but these errors were encountered: