function
::node_handle::get_allocator(C++17)
allocator_type get_allocator() const; // (1) C++17
constexpr allocator_type get_allocator() const; // (1) C++26
概要
格納されているアロケータ(元のコンテナのアロケータ)のコピーを返す。
要件
empty() == false
*alloc_
投げない。
例
#include <set>
int main()
{
std::set s = { 1, 2, 3 };
auto nh = s.extract(s.begin());
[[maybe_unused]] auto alloc = nh.get_allocator();
}
出力
バージョン
言語
処理系
参照