understanding vector idx.cpp