Let's say I write a DLL in C++ and would like to export a method which takes a std::vector parameter. Can I hope for any binary compatibility between different STL versions?
I'm not aware of any guarantees of compatibility between versions, not even between release and debug on the same compiler.
One solution is to create a wrapper for the vector. Create a class which has all the functions you require from the container, and implement them in terms of operations on the private vector which is the only member of the class. Keep all the class code in the DLL.
Absolutely not! You can't even rely on the same version of the STL being compatible if it was compiled with a different version of the same compiler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With