71 using streambuf_type = std::basic_streambuf<CharT, Traits>;
72 using traits_type = Traits;
73 using char_type = CharT;
74 using int_type =
typename traits_type::int_type;
76 template<
typename ForwardIterator>
77 basic_teebuf(ForwardIterator begin, ForwardIterator end) :
78 buffers_(begin, end) {}
81 int_type overflow(int_type c = traits_type::eof()) {
83 if (c == traits_type::eof()) {
return traits_type::eof(); }
85 typename std::vector<streambuf_type*>::iterator
87 for (iter = buffers_.begin(); iter != buffers_.end(); ++iter) {
88 if ((*iter)->sputc(c) == traits_type::eof()) {
89 return traits_type::eof();
93 return traits_type::not_eof(c);
98 if (traits_type::eq_int_type(overflow(traits_type::eof()),
99 traits_type::eof())) {
104 typename std::vector<streambuf_type*>::iterator iter;
105 for (iter = buffers_.begin(); iter != buffers_.end(); ++iter) {
106 if ((*iter)->pubsync() == -1) {
return -1; }
113 std::vector<streambuf_type*> buffers_;