aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-dataloader/detail/OStreamOutputIterator.hpp
blob: c71c105669a13e0b5c5d46f34cfa058bc18c12a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once

#include <ostream>

namespace ovdl::detail {
   struct OStreamOutputItertaor {
      std::reference_wrapper<std::ostream> _stream;

      auto operator*() const noexcept {
         return *this;
      }
      auto operator++(int) const noexcept {
         return *this;
      }

      OStreamOutputItertaor& operator=(char c) {
         _stream.get().put(c);
         return *this;
      }
   };
}