//<utility><xutility>常见模板操作函数
/*template <class _Ty, size_t _Size, class>
inline void swap(_Ty(&_Left)[_Size], _Ty(&_Right)[_Size]) template <class _Ty,
class>
inline void swap(_Ty & _Left, _Ty & _Right) template <class _Ty> inline //交换
void _Swap_adl(_Ty & _Left, _Ty & _Right)
template <class _Ty1, class _Ty2>
_NODISCARD constexpr bool operator==(const pair<_Ty1, _Ty2>& _Left, const
pair<_Ty1, _Ty2>& _Right) //相等判断
template<class _Ty1, class _Ty2> _NODISCARD constexpr bool operator!=( const
pair<_Ty1, _Ty2>& _Left, const pair<_Ty1, _Ty2>& _Right) //不相等判断
template <class _Ty1, class _Ty2>
_NODISCARD constexpr bool operator<(const pair<_Ty1, _Ty2>& _Left, const
pair<_Ty1, _Ty2>& _Right) //小于判断
template <class _Ty1, class _Ty2> _NODISCARD constexpr bool operator>( const
pair<_Ty1, _Ty2>& _Left, const pair<_Ty1, _Ty2>& _Right) //大于判断
template<class _Ty1,class _Ty2>
_NODISCARD constexpr bool operator<=(const pair<_Ty1, _Ty2>& _Left,const
pair<_Ty1, _Ty2>& _Right) //小于等于
template<class _Ty1,class _Ty2>
_NODISCARD constexpr bool operator>=(const pair<_Ty1, _Ty2>& _Left,const
pair<_Ty1, _Ty2>& _Right) //大于等于判断
template<class _Ty1,class _Ty2>
_NODISCARD constexpr pair<_Unrefwrap_t<_Ty1>, _Unrefwrap_t<_Ty2>>
make_pair(_Ty1&& _Val1, _Ty2&& _Val2) //构造pair
*/
std::pair<std::_Unrefwrap_t<int>, std::_Unrefwrap_t<int>> pairs =
std::make_pair<int, int>(1, 2);
std::pair<std::_Unrefwrap_t<int>, std::_Unrefwrap_t<int>> pairs1 =
std::make_pair<int, int>(3, 2);
if (pairs == pairs1) {
}
int a[] = {1, 2, 3};
int b[] = {4, 5, 6};
// copy [_First, _Last) to [_Dest, ...)
// std::copy<int*, int*>(a, a + 3, b); //从位置a[0]开始 拷贝到b[0]
// 拷贝3个
std::copy<int*, int*>(&a[1], &a[1] + 2, &b[1]); //从位置a[1] 拷贝2个数到b[0]
//对标准容器操作
std::vector<int> vec1;
vec1.push_back(1);
vec1.push_back(2);
vec1.push_back(3);
std::vector<int> vec2;
vec2.push_back(4);
vec2.push_back(5);
vec2.push_back(6);
std::vector<int>::iterator it1 = vec1.begin(), it2 = vec2.begin();
//std::copy<std::vector<int>::iterator, std::vector<int>::iterator>(it1, it1 + 2, it2); //copy [_First, _Last) to [_Dest, ...)
//std::move(it1, it1 + 3, it2); //=>std::move<std::vector<int>::iterator, std::vector<int>::iterator>(it1, it1 + 3, it2);
//for (it2 = vec2.begin(); it2 != vec2.end(); it2++)
//{
// std::cout << *it2 << std::endl;
//}
//for (it1 = vec1.begin(); it1 != vec1.end(); it1++) {
// std::cout << *it1 << std::endl;
//}
//copy [_First, _Last) backwards to [..., _Dest)
/*std::copy_backward(it1, it1 + 2, it2 + 2);
for (it2 = vec2.begin(); it2 != vec2.end(); it2++)
{
std::cout << *it2 << std::endl;
}*/
// move [_First, _Last) backwards to [..., _Dest)
std::move_backward(it1, it1 + 2, it2 + 2);
std::equal() compare [_First1, _Last1) to [_First2, ...)
详情参考<utility><xutility>
copy 是浅拷贝