Namespaces
Variants

std::uses_allocator<std::tuple>

From ko.cppreference.net
 
 
유틸리티 라이브러리
일반 유틸리티
관계 연산자 (C++20에서 폐지됨)
정수 비교 함수
(C++20)(C++20)(C++20)    
(C++20)
스왑 및 타입 연산
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
공통 어휘 타입
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)



 
 
헤더 <tuple>
template< class... Types, class Alloc >
struct uses_allocator< std::tuple<Types...>, Alloc > : std::true_type { };
(C++11부터)에 정의됨

std::uses_allocator의 이 특수화는 튜플에 uses-allocator 생성이 지원됨을 다른 라이브러리 구성 요소에 알려줍니다. 튜플에는 중첩된 allocator_type이 없더라도 마찬가지입니다.

std:: integral_constant 에서 상속됨

멤버 상수

value
[static]
true
(public static member constant)

멤버 함수

operator bool
객체를 bool 로 변환, value 반환
(public member function)
operator()
(C++14)
value 반환
(public member function)

멤버 타입

타입 정의
value_type bool
type std:: integral_constant < bool , value >

예제

// myalloc은 단일 인자 생성자를 가지는 상태 저장 Allocator입니다
// 생성자는 int를 받으며 기본 생성자는 없습니다
    using innervector_t = std::vector<int, myalloc<int>>;
    using elem_t = std::tuple<int, innervector_t>;
    using Alloc = std::scoped_allocator_adaptor< myalloc<elem_t>, myalloc<int>>;
    Alloc a(1,2);
    std::vector<elem_t, Alloc> v(a);
    v.resize(1);                  // v의 요소에 대해 allocator #1을 사용합니다
    std::get<1>(v[0]).resize(10); // innervector_t에 대해 allocator #2를 사용합니다

참고 항목

지정된 타입이 uses-allocator 생성 방식을 지원하는지 확인합니다
(클래스 템플릿)