ReactiveX / RxCpp

Reactive Extensions for C++
Apache License 2.0
3.03k stars 390 forks source link

Groupby operator implementation #457

Open athuls opened 6 years ago

athuls commented 6 years ago

My understanding from looking at the code is that the groupby operator implementation uses a std::map to map each key to the grouped_observable for aggregating values corresponding to the key. If that is the case, why do we use std::map? Why do we need to have ordering on the keys and incur the extra find/insert cost when all we are doing is a groupby?

kirkshoop commented 6 years ago

IMO map is a good default. I would be happy to see a PR with something like a template parameter to override the default associative container.