Namespaces
Variants

deduction guides for std::indirect

From cppreference.net
Memory management library
( exposition only* )
Allocators
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Memory resources
Uninitialized storage (until C++20)
( until C++20* )
( until C++20* )
( until C++20* )

Garbage collector support (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
定义于头文件 <memory>
template < class Value >
indirect ( Value ) - > indirect < Value > ;
(1) (C++26 起)
template < class Alloc, class Value >

indirect ( std:: allocator_arg_t , Alloc, Value )
- > indirect < Value, typename std:: allocator_traits < Alloc > ::

template rebind_alloc < Value >> ;
(2) (C++26 起)
1) 推导指引 std::indirect 提供,允许从单个值进行推导。
2) 此推导指南是为 std::indirect 提供的,允许从值类型与 Value 不同的分配器进行推导。

示例