Element at index in a std::set?

前端 未结 6 448
太阳男子
太阳男子 2020-12-03 00:46

I\'ve stumbled upon this problem: I can\'t seem to select the item at the index\' position in a normal std::set. Is this a bug in STD?

Below a simple ex

6条回答
  •  借酒劲吻你
    2020-12-03 01:48

    This is not a bug in the STD. There is no random access in a std::set. If you need random access by index, you can use std::vector

提交回复
热议问题