How to add valid key without specifying value to a std::map?

后端 未结 5 1208
不知归路
不知归路 2021-02-20 05:10

I have a std::map, and I would like to add a valid key to iterate over it later, but without giving any value (it will be given later on in the course of the iterations).

5条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-20 05:17

    /* I don't want to do that because in fact I don't use a float type */

    Then instead of std::map use the std::set.

提交回复
热议问题