multiset_end

multiset_end (std::multiset::end — 끝 이터레이터)

std::multiset의 마지막 원소 바로 뒤를 가리키는 이터레이터를 반환하는 멤버 함수예요. 이 원소는 placeholder 역할을 하며 접근하면 동작이 정의되지 않아요.

출처: cppreference

본문

시그니처는 다음과 같아요.

iterator end() noexcept;                 // (1)
const_iterator end() const noexcept;     // (2)
const_iterator cend() const noexcept;    // (3) (since C++11)

multiset의 마지막 원소를 뒤따르는 원소를 가리키는 이터레이터를 반환해요. 이 원소는 placeholder 역할을 하며, 접근을 시도하면 동작이 정의되지 않아요.

반환값

마지막 원소를 뒤따르는 원소를 가리키는 이터레이터.

복잡도

상수(constant)예요.

예제

#include <iostream>
#include <set>
int main()
{
    std::multiset<int> s{1, 2, 3};
    for (auto it = s.begin(); it != s.end(); ++it)
        std::cout << *it << ' ';   // 1 2 3
}

더 알아보기 (Learn more)

cppreference