I know of many people who initially wrote their programs in C++ instead of C, then decided to package the program's functionality as a library so rewrote it as a library in C so that it may be called from as many other different programming languages as possible.
My question is: is it possible to have a C++ library remain as it is (i.e. as C++) but still possible to be called from many other programming languages? How must it be modified to accomplish this goal? What features of C++ should one avoid so that the resultant library is as FFI-compliant as a C library is?
If C++ is not a good FFI language, is rust or some other programming language other than C is?