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_streambuf::eback - cpprefjp C++日本語リファレンス

  1. リファレンス
  2. streambuf
  3. basic_streambuf
  4. eback

最終更新日時: 2025年07月10日 09時58分01秒 (JST)
Koichi Murase が更新

履歴 編集

function
<streambuf>

std::basic_streambuf::eback

namespace std {
  template<class CharT, class Traits = char_traits<CharT>>
  class basic_streambuf {
  protected:
    char_type* eback() const;

    ……
  };
}

概要

入力部分列の先頭へのポインタを返す。

戻り値

入力部分列の先頭へのポインタ。

例

#include <iostream>
#include <streambuf>

// streambufを継承したクラス
class dummy_buf : public std::streambuf {
    char space_[10] = {'A', 'B', 'C'};
public:
    dummy_buf(void) {
        // 入力列に配列を設定
        setg(space_, space_, space_ + 10);
    }
    char_type* eback(void) const {
        // ベースクラスのeback()を呼ぶ
        return std::streambuf::eback();
    }
};

int main() {
    dummy_buf buf{};
    std::cout << *buf.eback() << std::endl;  // 先頭のポインタにアクセス
}

出力

A

バージョン

言語

  • C++98

参照

  • gptr()
  • egptr()
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.