swap(<utility>)
두 pair 구조체 개체의 요소를 교환합니다.
template<class Type1, class Type2>
void swap(pair<Type1, Type2>&_Left,
pair<Type1, Type2>&_Right);
매개 변수
Parameter |
설명 |
---|---|
_Left |
pair 형식의 개체입니다. |
_Right |
pair 형식의 개체입니다. |
설명
One advantage of swap is that the types of objects that are being stored are determined automatically by the compiler and do not have to be explicitly specified. Don't use explicit template arguments such as swap<int, int>(1, 2) when you use swap because it is unnecessarily verbose and adds complex rvalue reference problems that might cause compilation failure.
요구 사항
Header: <utility>
네임스페이스: std