Are there any guarantees about the layout of std::map? I know std::vector is guaranteed by the standard to have all objects sequential starting at *vector.begin(), is there any similar guarantee about std::map?.
Are there any guarantees about the layout of std::map ? I know std::vector is
Share
std::mapis usually implemented as a Red-Black tree. Nodes are allocated from the heap as needed, so it’s likely they end up in random places in memory. More formally, there’s no layout guarantee in the standard.