- streambuf[meta header]
- std[meta namespace]
- basic_streambuf[meta class]
- function[meta id-type]
namespace std {
template<class CharT, class Traits = char_traits<CharT>>
class basic_streambuf {
protected:
char_type* epptr() const;
……
};
}出力部分列の終端へのポインタを返す。
出力部分列の終端へのポインタ。
#include <iostream>
#include <streambuf>
// streambufを継承したクラス
class dummy_buf : public std::streambuf {
public:
dummy_buf(char* begin, char* end) {
// 出力列の領域を指定
setp(begin, end);
}
char_type* epptr(void) const {
// ベースクラスのepptr()を呼ぶ
return std::streambuf::epptr();
}
};
int main() {
char space[10] = {};
dummy_buf buf{space, space + 10};
std::cout << buf.epptr() - space << std::endl; // epptr()の位置を確認
}- std::streambuf::epptr[color ff0000]
10
- C++98