Feb 21, 2021 at 3:22am UTC
What actually is an associative container, what makes it one? Is it just if there is a key value pair? Is it anything to do with how it is stored in memory? I can not find anywhere that just simply explains what it is?
Feb 21, 2021 at 3:53am UTC
Feb 21, 2021 at 6:14am UTC
In strictly C++ terms, any type which meets certain formal requirements is an associative container:
But intuitively it meets the requirements if there's a key-value pair involved.
Last edited on
Feb 21, 2021 at 6:16am UTC
Feb 21, 2021 at 10:25am UTC
> Is it just if there is a key value pair?
Often, key value pairs, but could also it could also be just keys (as in sets).
Succinctly, associative containers provide "fast" retrieval of data based on "keys".
Topic archived. No new replies allowed.
General C++ Programming
© cplusplus.com, 2000-2020 - All rights reserved -
Spotted an error? contact us