diff options
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; +} |