std::vector differences

前端 未结 2 546
有刺的猬
有刺的猬 2021-02-13 00:57

How does one determine what the differences of 2 vectors are?

I have vector v1 and vector v2;

What I am looking

2条回答
  •  温柔的废话
    2021-02-13 01:16

    Do you want elements from both v1 and v2 that are unique and not in the other sequence? That sounds like std::set_symmetric_difference to me.

    Copies the elements of the range [first1,last1) that are not present in the range [first2, last2), and the elements of the range [first2,last2) that are not present in the range [first1, last1) to the range beginning at result. The elements in the constructed range are sorted.

提交回复
热议问题