Most C integration recommendations I've seen suggest using bindgen, but that doesn't give safe bindings.
Most C integration recommendations I've seen suggest using bindgen, but that doesn't give safe bindings.
Some of these properties could be deduced by a Sufficiently Smart Compiler, but you'd probably need an A.I. that reads the docs.
That's also true, in general, for C++, but CXX is nevertheless attempting to solve that problem.
CXX requires you to give some extra information when declaring the bridge. Presumably that can allow things to be less automatic.
I'm guessing that the reality is that if your C++ code is relatively idiomatic then CXX will work with it, but stray too far from idiomatic C++ - i.e. towards a C-style interface and CXX won't be able to do such a good job.
But it would be good to hear something more definitive.