std::scoped_allocator_adaptor<OuterAlloc,InnerAlloc...>:: allocate
From cppreference.net
<
cpp
|
memory
|
scoped allocator adaptor
C++
Memory management library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::scoped_allocator_adaptor
| Member functions | ||||
|
scoped_allocator_adaptor::allocate
|
||||
| Non-member functions | ||||
|
(until C++20)
|
||||
| Deduction guides (C++17) |
|
헤더에 정의됨
<scoped_allocator>
|
||
|
pointer allocate
(
size_type n
)
;
|
(1) | (C++11 이후) |
|
pointer allocate
(
size_type n, const_void_pointer hint
)
;
|
(2) | (C++11 이후) |
외부 할당자를 사용하여 초기화되지 않은 저장 공간을 할당합니다.
1)
std::
allocator_traits
<
OuterAlloc
>
::
allocate
(
outer_allocator
(
)
, n
)
를 호출합니다.
2)
추가적으로 메모리 지역성 힌트를 제공하며, 이를 위해
std::
allocator_traits
<
OuterAlloc
>
::
allocate
(
outer_allocator
(
)
, n, hint
)
를 호출합니다.
매개변수
| n | - | 저장 공간을 할당할 객체의 수 |
| hint | - | 인접 메모리 위치에 대한 포인터 |
반환값
할당된 저장소에 대한 포인터.
참고 항목
|
초기화되지 않은 저장 공간을 할당합니다
(
std::allocator<T>
의 public member function)
|
|
|
[static]
|
할당자를 사용하여 초기화되지 않은 저장 공간을 할당합니다
(
std::allocator_traits<Alloc>
의 public static member function)
|