|
![](/i/fill.gif) |
Is it a good idea to have STL classes in a public interface? That is,
returning a std::string or std::vector from a public method, or taking them
as arguments. I recall seeing recommendations against this somewhere, but I
don't remember the reasons.
If my library returns STL objects, and an app using my library is compiled
with a different STL implementation, that will definitely not work. (and if
it's compiled with a different C++ compiler, even basic classes may fail
due to ABI differences :P). But other from mixing STL implementations, is
there any reason why returning a string instead of a char* could be a bad
idea?
Post a reply to this message
|
![](/i/fill.gif) |