Is this only appropriate for the case where we want to iterate over all the elements? Don't we lose the O(1) access using a name? I'm assuming you're making 2 arrays.
Yes. My point is to consider what is actually required before making complex structures. It is often perfectly acceptable to combine two existing types and handle what few interactions they actually have.