summaryrefslogtreecommitdiffhomepage
path: root/debug.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2025-01-04 11:28:20 +0100
committerRoland Reichwein <mail@reichwein.it>2025-01-04 11:28:20 +0100
commitb2c35cdf69a9084806ac7930cf4475980d596cf6 (patch)
treeb74b8f2ee2c66c59f7385407cfc34c2a0a16961f /debug.cpp
parentaaafcea7e26791acbf5b9612e3fb396edcdfcc8f (diff)
Separate out implementation from headers
Diffstat (limited to 'debug.cpp')
-rw-r--r--debug.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/debug.cpp b/debug.cpp
index 09c9fcc..096c894 100644
--- a/debug.cpp
+++ b/debug.cpp
@@ -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;
+}