پاسخ داده شده: تفاوت کلاس های map,multimap
سلام؛ برای وقتی که بخوایم یک سری داده ای بر اساس کلیدهایی رو داشته باشید، مثلاً یک ساختاری مثل Json. در std::map شما نمی تونید که کلید تکراری داشته باشید ولی در std::mulimap این اجازه به شما داده میشه.
به نقل از cppreferences:
Multimap is an associative container that contains a sorted list of key-value pairs, while permitting multiple entries with the same key. Sorting is done according to the comparison function
Compare, applied to the keys. Search, insertion, and removal operations have logarithmic complexity.
