update createNextIterationMap function to new C++ interface.
@cs15btech11044, I try to get you involved in the code review process. Would you like to review this patch?
Thank you for letting me review this patch.
LGTM. @grosser, could you please commit this patch (I do not have commit rights as of now)?