Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

43 строки
760 B

  1. #pragma once
  2. namespace utl {
  3. namespace logging {
  4. struct message
  5. {
  6. private:
  7. std::ostringstream _msg;
  8. public:
  9. inline std::string str() const
  10. { return _msg.str(); }
  11. template <typename T>
  12. inline message& operator <<(const T& value)
  13. {
  14. _msg << value;
  15. return *this;
  16. }
  17. inline message& operator <<(std::ostream& (*callback)(std::ostream&))
  18. {
  19. callback(_msg);
  20. return *this;
  21. }
  22. message() :
  23. _msg()
  24. { }
  25. message(const std::string& msg) :
  26. _msg(msg)
  27. { }
  28. private:
  29. message(message&&) = delete;
  30. message(const message&) = delete;
  31. };
  32. }
  33. }