I think it would be better to standardise on a VTK object for enumeration of containers. It would work for input and output in the vtkContourFilter
example.
All the wrapper languages support the concept of enumerable/iterator classes/interfaces and COM provides an example of how for, foreach and while not done loops are handled by multiple .net languages in a consistent manner via the IEnumVARIANT interface.
In VTK it could look something like this
template <typename T>
class vtkEnumerable
{
public:
bool Next(const long number_to_fetch, T items[], long& number_fetched);
bool Skip(const long count);
bool Reset();
vtkEnumerable<T> Clone();
};
C++ implementations could wrap std::vector<>
, std::list<>
, std::array<>
without loss of generality.