std::splice splice는 한 list에서 다른 list로 원소들을 옮기는 함수. 원소들은 복사(copy)나 이동(move)되지 않고 포인터 주소만 옮겨 담는다. 파라미터 pos 삽입될 원소 위치 other 콘텐츠를 전송할 다른 컨테이너 it other에서 *this로 전송할 원소 first, last other에서 *this로 전송할 원소의 범위 #include #include std::ostream& operator 프로그래밍/Morden C++ 2021.07.13
std::advance advance 함수는 주어진 iterator를 n개 이동해 모든 컨테이너를 배열처럼 접근할 수 있게 해준다. return value는 없고 iterator 자체가 수정됨 #include #include #include int main() { std::vector v{ 3, 1, 4 }; auto vi = v.begin(); std::advance(vi, 2); std::cout std::advance - cppreference.com template void advance( InputIt& it, Distance n ); (until C++17) template constexpr void.. 프로그래밍/Morden C++ 2021.07.13