Slide 71
Slide 71 text
多相アロケータ
アロケータおさらい
71
uses-allocator 構築
obj を構築対象の T 型のオブジェクト、v1, v2, …, vN をそれぞれ V1, V2, …, VN 型
のコンストラクタ引数、alloc を Alloc 型のアロケータとすると…
• std::uses_allocator_v が false で、かつ std::is_constructible_v が true なら、obj(v1, v2, ..., vN) として構築
• そうでなくて、std::uses_allocator_v が true で、かつ
std::is_constructible_v が true な
ら、obj(std::allocator_arg, alloc, v1, v2, ..., vN) として構築
• そうでなくて、std::uses_allocator_v が true で、かつ
std::is_constructible_v が true なら、obj(v1, v2, ..., vN,
alloc) として構築
• 上記のいずれでもない場合、ill-formed