POV-Ray : Newsgroups : povray.off-topic : STL in public interfaces (C++) : STL in public interfaces (C++) Server Time
7 Sep 2024 11:22:24 EDT (-0400)
  STL in public interfaces (C++)  
From: Nicolas Alvarez
Date: 22 May 2008 16:30:39
Message: <4835d7ef@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.