title: Safely use containers in C++ library interface
body: <p>When designing a C++ library, I read it is bad practice to include standard library containers like <code>std::vector</code> in the public interface (see e.g. <a href="https://stackoverflow.com/questions/10573130/implications-of-using-stdvector-in-a-dll-exported-function">Implications of using std::vector in a dll exported function</a>).</p>
  
  <p>What if I want to expose a function that takes or returns a list of objects? I could use a simple array, but then I would have to add a <code>count</code> parameter, which makes the interface more cumbersome and less safe. Also it wouldn't help much if I wanted to use a <code>map</code>, for example. I guess libraries like Qt define their own containers which are safe to export, but I'd rather not add Qt as a dependency, and I don't want to roll my own containers.</p>
  
  <p>What's the best practice to deal with containers in the library interface? Is there maybe a tiny container implementation (preferably just one or two files I can drop in, with a permissive license) that I can use as "glue"? Or is there even a way to make <code>std::vector</code> etc. safe across .DLL/.so boundaries and with different compilers?</p>