avatar
STL set and map question# Programming - 葵花宝典
vi
1
It feels like whereever you need a map, it can be done by a set,
by defining the key of the map as the key for the set, and have
the value of the map as regular data members.
What's the rational to make the difference between the two? Thanks.
avatar
c*r
2

How would you associate the "regular data members" with the keys?

【在 vi 的大作中提到】
: It feels like whereever you need a map, it can be done by a set,
: by defining the key of the map as the key for the set, and have
: the value of the map as regular data members.
: What's the rational to make the difference between the two? Thanks.

avatar
vi
3

If a map has the key T and Value V, then let's make a set with key {T, N},
where T = *(set::iterator).

【在 c*r 的大作中提到】
:
: How would you associate the "regular data members" with the keys?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。