[Swift/C++] User survey: how would you use C++ interoperability?

Thank you for this! I have used SwiftNIO minimally so far (mostly ByteBuffer for easing implementation of parsers and binary generators in projects like Cyborg, which provides CBOR tooling.)

Interesting. As a slight segue here, do you see this sort of strategy changing over time - for instance, would you consider moving to a common arbitrary precision integer type such as one in Swift Numerics, or would that generally be more trouble than its worth considering the bridging between that and the needed type by an underlying crypto engine?

Since I imagine there are often similar memory management patterns within a codebase for multiple exposed types, did you ever consider building a generic type, e.g. one that works around BoringSSL CryptoBuffers and not specifically one for PeerCertificateChains?

The flip side of this I imagine is that your types may have some functional limitations because your wrapper doesn't have certain features you would get 'for free' with native swift code.

A CryptoKit/SwiftCrypto example might be that you can't initialize a digest to an arbitrary value, which limits your ability to do certain things (like implement Codable) and treat a digest as a specialized Data type.

Likewise, a PeerCertificateChainBuffers type would need to be copied into an Array for use in many API, simply because [Foo] is easier to type than RandomAccessCollection where Element: Foo (although perhaps not the best example for this class as it appears to be internal.)

Ahh, that was somewhat my expectation but I wondered if there were any generic tools to do so, such as a malloc/free'd buffer you could leverage for the inner class and do CoW patterns on.

Have you had to deal with exposing internal types for compatibility when users want to call other C API?