GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • cpprefjp - C++日本語リファレンス
  • GitHub Project

This view

  • Original page
  • New address

GeezerVison is showing cpprefjp.github.io — std::basic_stringbuf::get_allocator - cpprefjp C++日本語リファレンス

  1. リファレンス
  2. sstream
  3. basic_stringbuf
  4. get_allocator

最終更新日時: 2026年09月19日 21時31分51秒 (JST)
rotarymars が更新

履歴 編集

function
<sstream>

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

allocator_type get_allocator() const noexcept;

概要

アロケータを取得する。

戻り値

内部の文字列バッファが保持しているアロケータのコピー。

例

#include <iostream>
#include <sstream>

int main()
{
  std::stringbuf buf;

  auto alloc = buf.get_allocator();

  // アロケータの型名を出力(処理系依存)
  std::cout << typeid(alloc).name() << std::endl;
}

出力例

std::allocator<char>

バージョン

言語

  • C++20

処理系

  • Clang: 17.0.6 ✅
  • GCC: 12 ✅
  • Visual C++: ??

参照

  • P0408R7 Efficient Access to basic_stringbuf's Buffer
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.