L
Leo jay
dear all,
i want to write log on disk file when macro NEED_DO_LOG is defined.
otherwise, do nothing.
so i wrote code like this:
#ifdef NEED_DO_LOG
fstream fsLogFile (...);
#else
CDummyStream fsLogFile;
#endif // #ifdef ASSAENGINE_NEED_DO_LOG
what i need to do now is making the CDummyStream acts like a fstream.
i wrote these code:
template <typename T>
CDummyStream& operator << (CDummyStream& dummy, const T& t)
{
return dummy;
}
above code can handle int, double, etc. but it can't handle the
function 'endl'.
if i write:
fsLogFile << endl;
the vs.net2003 compiler complains it could not deduce template argument
for 'overloaded function type' from 'overloaded function type'. what's
the meaning of that?
is that possible to pass endl as a parameter?
thanks.
i want to write log on disk file when macro NEED_DO_LOG is defined.
otherwise, do nothing.
so i wrote code like this:
#ifdef NEED_DO_LOG
fstream fsLogFile (...);
#else
CDummyStream fsLogFile;
#endif // #ifdef ASSAENGINE_NEED_DO_LOG
what i need to do now is making the CDummyStream acts like a fstream.
i wrote these code:
template <typename T>
CDummyStream& operator << (CDummyStream& dummy, const T& t)
{
return dummy;
}
above code can handle int, double, etc. but it can't handle the
function 'endl'.
if i write:
fsLogFile << endl;
the vs.net2003 compiler complains it could not deduce template argument
for 'overloaded function type' from 'overloaded function type'. what's
the meaning of that?
is that possible to pass endl as a parameter?
thanks.