0

I want to store an event and its subscriber and publisher in a map. Here map key is the event and mapped value is subscriber and the publisher. But the type of publisher and subscriber are different. But map gives only a certain type of mapped value.

How to handle this things or is there any other data structure for it??

4

1 回答 1

2

似乎每个事件都有一个发布者和一个订阅者,因此最好将您的地图从事件到std::pair发布者和订阅者。这样,您还将保留两者之间的关系。

于 2013-09-26T14:08:11.560 回答