#pragma once #include #include class debug_ostream { public: debug_ostream(); void activate(); void deactivate(); template debug_ostream& operator<<(const T& arg) { if (m_active) std::cout << arg; return *this; } debug_ostream& operator<<( std::basic_ostream& (*func) (std::basic_ostream&) ); private: bool m_active; }; extern debug_ostream debug_cout;