最終更新日時(UTC):
が更新

履歴 編集

function
<syncstream>

std::basic_syncbuf::get_allocator(C++20)

allocator_type get_allocator() const noexcept;

概要

アロケータのコピーを取得する。

戻り値

コンストラクタまたは代入演算子によって設定されたアロケータのコピーを返す。

例外

投げない。

#include <syncstream>
#include <iostream>

int main()
{
  std::osyncstream bout{std::cout};
  bout << "Hello, World!";
  auto alloc = bout.rdbuf()->get_allocator();
}

出力

Hello, World!

バージョン

言語

  • C++20

処理系

参照