set_symmetric_difference (1) template<classInputIt1,classInputIt2,classOutputIt>OutputIt set_symmetric_difference(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt d_first){while(first1!=last1){if(first2==last2)returnstd::copy(first1, last1, d_first);if(...
std::set_symmetric_difference 定义于头文件<algorithm> (1) template<classInputIt1,classInputIt2,classOutputIt> OutputIt set_symmetric_difference(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt d_first);
template< class InputIt1, class InputIt2, class OutputIt > OutputIt set_symmetric_difference( InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt d_first ); (1) template< class ExecutionPolicy, class ForwardIt1, class ForwardIt2, class ForwardIt3 > Forwar...
template< class ExecutionPolicy, class ForwardIt1, class ForwardIt2, class ForwardIt3 > ForwardIt3 set_symmetric_difference( ExecutionPolicy&& policy, ForwardIt1 first1, ForwardIt1 last1, ForwardIt2 first2, ForwardIt2 last2, ForwardIt3 d_first ); (2) (C++17 起) ...
std::set、multiset和unordered_set(hash_set) 中文标准库:multiset 一、构造 二、set在标准库中的算法 标准库algorithm std::set_union 计算两个集合的并集 set_symmetric_difference 计算两个集合的对称差 std::set_intersection 计算两个集合的交集 std::set_difference 计算两个集合的差集转载:set_difference的...
// CPP program to demonstrate use of// std::set_symmetric_difference#include<iostream>#include<algorithm>#include<vector>#include<string>usingnamespacestd;// Driver codeintmain(){stringfirst[] = {"John","Bob","Mary","Serena"};stringsecond[] = {"Jim","Mary","John","Bob"};intn =siz...
cout<<"Difference:"; copy(eg3.begin(),eg3.end(),ostream_iterator<int>(cout," ")); cout<<endl; //获得两个set的对称差,也就是假设两个集合分别为A和B那么对称差为AUB-A∩B eg3.clear(); set_symmetric_difference(eg1.begin(),eg1.end(),eg2.begin(),eg2.end(),insert_iterator<set<...
cout<<"Difference:"; copy(eg3.begin(),eg3.end(),ostream_iterator<int>(cout," ")); cout<<endl; //获得两个set的对称差,也就是假设两个集合分别为A和B那么对称差为AUB-A∩B eg3.clear(); set_symmetric_difference(eg1.begin(),eg1.end(),eg2.begin(),eg2.end(),insert_iterator<set<...
ranges::set_union (C++20) computes the union of two sets (niebloid) ranges::set_intersection (C++20) computes the intersection of two sets (niebloid) ranges::set_symmetric_difference (C++20) computes the symmetric difference between two sets ...
ForwardIt3 set_difference(ExecutionPolicy&&policy, ForwardIt1 first1, ForwardIt1 last1, ForwardIt2 first2, ForwardIt2 last2, ForwardIt3 d_first, Compare comp); (4)(C++17 起) 复制来自已排序范围[first1, last1)并且不在已排序范围[first2, last2)中找到的元素到始于d_first的范围。