//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template > // class basic_streambuf; // streamsize sgetn(char_type* s, streamsize n); #include #include int xsgetn_called = 0; struct test : public std::basic_streambuf { test() {} protected: std::streamsize xsgetn(char_type* s, std::streamsize n) { ++xsgetn_called; return 10; } }; int main() { test t; assert(xsgetn_called == 0); assert(t.sgetn(0, 0) == 10); assert(xsgetn_called == 1); }