No iterator for Java when using SWIG with C++'s std::map
问题 I have implemented a class with std::map in C++ and created interface using SWIG to be call from Java. However there is no iterator object that allows me to iterate through the entries in the SWIG wrapped std::map . Does anyone know how to create an iterator? 回答1: In order to be able to iterate over an Object in Java it needs to implement Iterable . This in turn requires a member function called iterator() which returns a suitable implementation of an Iterator . From your question it's not