Using C++ streams from Swift

Hi there, super excited to try out C++/Swift interop.

One question regarding usage of C++ streams in Swift, is that possible and are there examples available somewhere – how would you go about creating a stream from Swift and then using C++ stream operators implemented for some classes with it, from Swift?

Thanks for your help. Looks like a super cool project, just needing a little bit of help to get started with what's possible today.

Best, ilu

1 Like

You should be able to construct a stream using it's C++ constructor and then use the shift operators on it (<< for example). Are you running into problems with a specific API?

(I should add: basic_ostream will require our experimental move-only type support.)