C++ algorithm like python's 'groupby'

后端 未结 6 610
再見小時候
再見小時候 2020-12-15 22:20

Are there any C++ transformations which are similar to itertools.groupby()?

Of course I could easily write my own, but I\'d prefer to leverage the idiomatic behavior

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-15 22:58

    I recently discovered cppitertools.

    It fulfills this need exactly as described.

    https://github.com/ryanhaining/cppitertools#groupby

提交回复
热议问题