]> git.lyx.org Git - lyx.git/blobdiff - src/support/debugstream.h
* lyxfunctional.h: delete compare_memfun and helper classes
[lyx.git] / src / support / debugstream.h
index 9340def08cab32f1b50847f891a8156efa94906f..c41d4d94b175988c6c2dfff91fe5e68ca6e45fe4 100644 (file)
 #ifndef DEBUG_STREAM_HPP
 #define DEBUG_STREAM_HPP
 
+#include <iostream>
+
 #include <boost/test/detail/nullstream.hpp>
 
+#ifdef DEBUG
+# define TEMPORARY_DEBUG_MACRO DEBUG
+# undef DEBUG
+#endif
 
 struct debug_trait {
        enum type {
@@ -34,6 +40,11 @@ struct debug_trait {
        }
 };
 
+#ifdef TEMPORARY_DEBUG_MACRO
+# define DEBUG TEMPORARY_DEBUG_MACRO
+# undef TEMPORARY_DEBUG_MACRO
+#endif
+
 
 template <class dtrait,
          class charT = char,
@@ -43,6 +54,10 @@ public:
        typedef dtrait debug;
        typedef typename debug::type Type;
 
+       basic_debugstream()
+               : std::basic_ostream<charT, traits>(0), dt(debug::NONE)
+       {}
+
        /// Constructor, sets the debug level to t.
        explicit basic_debugstream(std::basic_streambuf<charT, traits> * buf)
                : std::basic_ostream<charT, traits>(buf), dt(debug::NONE)