forward_list_get_allocator

forward_list_get_allocator (std::forward_list::get_allocator — 할당자 반환)

std::forward_list에 연결된 할당자(allocator)를 반환하는 멤버 함수예요.

출처: cppreference

본문

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

allocator_type get_allocator() const noexcept;   // (since C++11)

컨테이너에 연결된 할당자를 반환해요.

반환값

연결된 할당자.

복잡도

상수(constant)예요.

예제

#include <forward_list>
#include <memory>
int main()
{
    std::forward_list<int> fl;
    auto a = fl.get_allocator();
    // a로 원소 메모리를 할당할 수 있어요
}

더 알아보기 (Learn more)

cppreference