Can set_intersection be used with hash_set in C++?

后端 未结 3 1496
遇见更好的自我
遇见更好的自我 2021-01-22 03:09

I am calculating intersection, union and differences of sets. I have a typedef of my set type:

typedef set node_set;

When it i

3条回答
  •  孤城傲影
    2021-01-22 03:39

    No, you can't use set_intersection because set_intersection requires that the two sets are ordered (using the same ordering). Hash sets aren't ordered in any way. In C++0x they will in fact be called unordered_set.

提交回复
热议问题