diff options
author | Roland Reichwein <mail@reichwein.it> | 2025-01-04 11:28:20 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2025-01-04 11:28:20 +0100 |
commit | b2c35cdf69a9084806ac7930cf4475980d596cf6 (patch) | |
tree | b74b8f2ee2c66c59f7385407cfc34c2a0a16961f /debug.cpp | |
parent | aaafcea7e26791acbf5b9612e3fb396edcdfcc8f (diff) |
Separate out implementation from headers
Diffstat (limited to 'debug.cpp')
-rw-r--r-- | debug.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -1,3 +1,23 @@ #include "debug.h" debug_ostream debug_cout; + +debug_ostream::debug_ostream(): m_active(false) {} + +void debug_ostream::activate() +{ + m_active = true; +} + +void debug_ostream::deactivate() +{ + m_active = false; +} + +debug_ostream& debug_ostream::operator<<( + std::basic_ostream<char>& (*func) + (std::basic_ostream<char>&) ) { + if (m_active) + std::cout << *func; + return *this; +} |