brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 523f0da Raw
40 lines · c
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef TEST_STD_INPUT_OUTPUT_SYNCSTREAM_SYNCBUF_SYNCSTREAM_SYNCBUF_MEMBERS_H10#define TEST_STD_INPUT_OUTPUT_SYNCSTREAM_SYNCBUF_SYNCSTREAM_SYNCBUF_MEMBERS_H11 12#include <streambuf>13#include <syncstream>14 15template <class T>16class test_buf : public std::basic_streambuf<T> {17public:18  int id;19 20  test_buf(int _id = 0) : id(_id) {}21 22  T* _pptr() { return this->pptr(); }23};24 25template <class T, class Alloc = std::allocator<T>>26class test_syncbuf : public std::basic_syncbuf<T, std::char_traits<T>, Alloc> {27public:28  test_syncbuf(test_buf<T>* buf, Alloc alloc) : std::basic_syncbuf<T, std::char_traits<T>, Alloc>(buf, alloc) {}29 30  void _setp(T* begin, T* end) { return this->setp(begin, end); }31};32 33template <class T>34struct test_allocator : std::allocator<T> {35  int id;36  test_allocator(int _id = 0) : id(_id) {}37};38 39#endif // TEST_STD_INPUT_OUTPUT_SYNCSTREAM_SYNCBUF_SYNCSTREAM_SYNCBUF_MEMBERS_H40