cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Maps - Where "keys" and "values" are the
Maps - Where "keys" and "values" are the same
Jul 21, 2011 at 1:18pm UTC
NewProgrammer
(58)
Hi everyone,
In what applications would it make sense for the key and value in a map to be the same?
Jul 21, 2011 at 1:37pm UTC
Athar
(4466)
None, you would be using a std::set instead (unless you're talking about types only).
Jul 21, 2011 at 1:45pm UTC
NewProgrammer
(58)
I thought as much.
In my textbook, "Data Structures and Algorithms in C++", it states "In some applications, the key and the value may be the same." That may be true, but intuitively I wondered if that still follows behind the purpose of a map.
Topic archived. No new replies allowed.