Does the new C++ interoperability allow the main() function to reside in the C++ code, or is it meant only to assist with making it easier to add C++ code to an existing Swift program?
I believe the answer is yes, and I think the C++ interop project is a bidirectional interop project.
Yes, it's totally possible to have a program whose main entry point is in C++ but that invokes Swift APIs from it. We will be posting a sample CMake project in the near future that showcases this kind of setup , so stay tuned for that :)
1 Like
I also wonder if there is any C++ code that might be problematic, for instance what uses threads, or lots of templates or even complicated preprocessor macros.