Skip to content
Snippets Groups Projects
Commit 677c924e authored by Christian Beckmann's avatar Christian Beckmann
Browse files

gcc3 changes

parent 57154cf8
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,7 @@ determining streaming to the Logfile and/or cout. */ ...@@ -20,6 +20,7 @@ determining streaming to the Logfile and/or cout. */
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <iomanip>
#include <strstream> #include <strstream>
#include "newmatap.h" #include "newmatap.h"
#include "newmatio.h" #include "newmatio.h"
...@@ -134,6 +135,8 @@ namespace Utilities{ ...@@ -134,6 +135,8 @@ namespace Utilities{
bool stream_to_logfile; bool stream_to_logfile;
bool stream_to_cout; bool stream_to_cout;
friend Log& operator<<(Log& log, ostream& (*obj) (ostream &));
template<class t> template<class t>
friend Log& operator<<(Log& log, const t& obj); friend Log& operator<<(Log& log, const t& obj);
...@@ -214,6 +217,18 @@ namespace Utilities{ ...@@ -214,6 +217,18 @@ namespace Utilities{
return dir + "/" + filename; return dir + "/" + filename;
} }
inline Log& operator<<(Log& log, ostream& (*obj)(ostream &))
{
if(log.stream_to_logfile)
log.logfileout << obj;
if(log.stream_to_cout)
cout << obj;
return log;
}
} }
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment