libfly  6.2.2
C++20 utility library for Linux, macOS, and Windows
styler_proxy.hpp
1 #pragma once
2 
3 #include <ostream>
4 
5 namespace fly::logger::detail {
6 
16 {
17 public:
24  explicit StylerProxy(std::ostream &stream) noexcept;
25 
30  virtual ~StylerProxy() = default;
31 
40  template <typename T>
41  friend std::ostream &operator<<(const StylerProxy &proxy, const T &value)
42  {
43  return proxy.m_stream << value;
44  }
45 
46 protected:
47  std::ostream &m_stream;
48 
49  const bool m_stream_is_stdout;
50  const bool m_stream_is_stderr;
51 };
52 
53 } // namespace fly::logger::detail
Definition: styler_proxy.hpp:16
StylerProxy(std::ostream &stream) noexcept
Definition: styler_proxy.cpp:8
friend std::ostream & operator<<(const StylerProxy &proxy, const T &value)
Definition: styler_proxy.hpp:41