I'd like to step in here and say that you make good points, Karthas, but jjonj is also right in that C-style arrays should be avoided in C++, with one of the only exceptions being if one needs to interface to a third-party library that needs C-style arrays. Which is somewhat the case here, although there's the alternative of `return_stl_iterator` that jjonj mentioned above.

> Whatever 'risks' you're thinking of don't apply here.

That's not quite true, because you made `getCompoundIds` part of the public C++ interface of the `CompoundRegistry`. Those risks may not apply right now, but who knows how people will use this function in the future?

Since `getCompoundIds` is not used anywhere but in the Lua bindings, I would suggest making it a static function in `compound.cpp`, thus removing it from the public interface. Either that or make it return a vector. Your call.