its *not* a deep copy. This is what I meant earlier. The new instance will use the same memory for the index vector as the old one. This should not happen in fact. So I suggest to get rid of the copy constructor here and use the clone method (deep copy) instead in the duplicate method